Day 20 (Part 2 fi-na-l-l-yyyyy)

This commit is contained in:
Sebastian Seedorf
2020-12-28 22:18:55 +01:00
parent aef62199e6
commit 61ad0cbf38
3 changed files with 170 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python3
import numpy as np
l = 1000000000000
l = -1
def calc(line):
x = 0
@@ -14,7 +14,7 @@ def solve(arr, pos, s, left_keys):
if pos >= s*s:
return True
idx = (pos // s * 2, pos % s * 2)
if l > len(left_keys):
if l != len(left_keys):
print("-"*pos, pos, len(left_keys), idx)
l = len(left_keys)
top = (idx[0], idx[1]-1) if idx[1] > 0 else None