Return answer in the wanted format for our tests.

This commit is contained in:
2017-12-16 15:15:17 +01:00
parent 06c422f2dd
commit d828b1a78e

View File

@@ -16,18 +16,20 @@ def main():
counter = 0 counter = 0
for i, entry in enumerate(entry_list): for i, entry in enumerate(entry_list):
entry = int(entry)-1 entry = int(entry)-1
if entry == 0 and light_state: if entry == 0:
counter += 1 if light_state:
light_state = False counter += 1
if (counter >= 99): light_state = False
highest_value.append(i) if (counter >= 99):
highest_value.append(i)
else: else:
if memory[entry] == False and light_state == False: if memory[entry] == False and light_state == False:
memory[entry] = True memory[entry] = True
light_state = True light_state = True
answer = min(highest_value)+1
print(min(highest_value)+1) print(answer)
return answer
if __name__ == '__main__': if __name__ == '__main__':
main() main()