[:] does the same and is minimally faster than .copy()

This commit is contained in:
Stefan Harmuth 2020-12-08 06:36:24 +01:00
parent f9a0472f85
commit 29b0604952

View File

@ -45,7 +45,7 @@ def part2(test_mode=False):
if not check_command.startswith('nop') and not check_command.startswith('jmp'):
continue
check_code = my_input.copy()
check_code = my_input[:]
if check_command.startswith('nop'):
check_code[counter] = check_code[counter].replace('nop', 'jmp')