Skip to content

Instantly share code, notes, and snippets.

@dpliakos
Created January 27, 2018 19:26
Show Gist options
  • Save dpliakos/3b88bba5c94bb4573e79bf9f73f74564 to your computer and use it in GitHub Desktop.
Save dpliakos/3b88bba5c94bb4573e79bf9f73f74564 to your computer and use it in GitHub Desktop.
Excited cells challenge code for 300/300 in python3
for j in range(0, steps):
tempState = []
for i in range(0,len(initialState)):
if len(initialState)-1 != i:
right = initialState[i+1]
else:
right = initialState[0]
if initialState[i-1] + right == 1:
tempState.append(1)
else:
tempState.append(0)
initialState = tempState
print(','.join([str(x) for x in initialState]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment