#!/usr/bin/env checkio --domain=py run node-disconnected-users2

# 
# END_DESC

def disconnected_users(net, users, source, crushes):

    for i in net:
        for c in crushes: 
            if c in i:
                i.remove(c)
    print('remove crashed:', net)

    working_net = []
    for x in net:
        if len(x) == 2:
            working_net.append(x)
    
    print('removed single:', working_net)

    return 0

if __name__ == '__main__':
    #These "asserts" using only for self-checking and not necessary for auto-testing
    assert disconnected_users([
        ['A', 'B'],
        ['B', 'C'],
        ['C', 'D']
    ], {
        'A': 10,
        'B': 20,
        'C': 30,
        'D': 40
    },
        'A', ['C']) == 70, "First"

    # assert disconnected_users([
    #     ['A', 'B'],
    #     ['B', 'D'],
    #     ['A', 'C'],
    #     ['C', 'D']
    # ], {
    #     'A': 10,
    #     'B': 0,
    #     'C': 0,
    #     'D': 40
    # },
    #     'A', ['B']) == 0, "Second"

    # assert disconnected_users([
    #     ['A', 'B'],
    #     ['A', 'C'],
    #     ['A', 'D'],
    #     ['A', 'E'],
    #     ['A', 'F']
    # ], {
    #     'A': 10,
    #     'B': 10,
    #     'C': 10,
    #     'D': 10,
    #     'E': 10,
    #     'F': 10
    # },
    #     'C', ['A']) == 50, "Third"

    print('Done. Try to check now. There are a lot of other tests')
92cd542efa9797d6334f9d1b6b9376d29fa17bec
<mask token>

def disconnected_users(net, users, source, crushes):
    for i in net:
        for c in crushes:
            if c in i:
                i.remove(c)
    print('remove crashed:', net)
    working_net = []
    for x in net:
        if len(x) == 2:
            working_net.append(x)
    print('removed single:', working_net)
    return 0


<mask token>

def disconnected_users(net, users, source, crushes):
    for i in net:
        for c in crushes:
            if c in i:
                i.remove(c)
    print('remove crashed:', net)
    working_net = []
    for x in net:
        if len(x) == 2:
            working_net.append(x)
    print('removed single:', working_net)
    return 0


if __name__ == '__main__':
    assert disconnected_users([['A', 'B'], ['B', 'C'], ['C', 'D']], {'A': 
        10, 'B': 20, 'C': 30, 'D': 40}, 'A', ['C']) == 70, 'First'
    print('Done. Try to check now. There are a lot of other tests')

#!/usr/bin/env checkio --domain=py run node-disconnected-users2

# 
# END_DESC

def disconnected_users(net, users, source, crushes):

    for i in net:
        for c in crushes: 
            if c in i:
                i.remove(c)
    print('remove crashed:', net)

    working_net = []
    for x in net:
        if len(x) == 2:
            working_net.append(x)
    
    print('removed single:', working_net)

    return 0

if __name__ == '__main__':
    #These "asserts" using only for self-checking and not necessary for auto-testing
    assert disconnected_users([
        ['A', 'B'],
        ['B', 'C'],
        ['C', 'D']
    ], {
        'A': 10,
        'B': 20,
        'C': 30,
        'D': 40
    },
        'A', ['C']) == 70, "First"

    # assert disconnected_users([
    #     ['A', 'B'],
    #     ['B', 'D'],
    #     ['A', 'C'],
    #     ['C', 'D']
    # ], {
    #     'A': 10,
    #     'B': 0,
    #     'C': 0,
    #     'D': 40
    # },
    #     'A', ['B']) == 0, "Second"

    # assert disconnected_users([
    #     ['A', 'B'],
    #     ['A', 'C'],
    #     ['A', 'D'],
    #     ['A', 'E'],
    #     ['A', 'F']
    # ], {
    #     'A': 10,
    #     'B': 10,
    #     'C': 10,
    #     'D': 10,
    #     'E': 10,
    #     'F': 10
    # },
    #     'C', ['A']) == 50, "Third"

    print('Done. Try to check now. There are a lot of other tests')