Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First nodes vs. second nodes solution in Creative category for New Cities by lulufox2727
def subnetworks(net, crushes):
first = ''
second = ''
mayors = 0
for i in net:
first += i[0]
second += i[1]
if i[0] in crushes: i[0] = 'broken'
if i[1] in crushes: i[1] = 'broken'
for i in net:
if i[0] not in first and i[0] in second:
mayors += 1
second = second.replace(i[0],'')
if i[1] not in first and i[1] in second:
mayors += 1
second = second.replace(i[1],'')
elif i[0] in first and i[1] == 'broken':
mayors += 1
return mayors
April 1, 2019