Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
4-liner: based on gregz's solution in Creative category for Node Disconnected Users by przemyslaw.daniel
def disconnected_users(net, users, source, crushes):
is_reachable = lambda src, node: src not in crushes and \
(sum([is_reachable(b, node) for a, b in net if a == src]) or src == node)
return sum([users[x] for x in users if not is_reachable(source, x)])
Oct. 26, 2017
Comments: