[py] Solve 2022_06

This commit is contained in:
Joscha 2022-12-06 11:02:38 +01:00
parent 5e92bddc15
commit fa688258ca
2 changed files with 11 additions and 1 deletions

9
py/aoc/y2022/d06.py Normal file
View file

@ -0,0 +1,9 @@
def scan(s, lookback):
for i in range(len(s) - lookback + 1):
if len(set(s[i : i + lookback])) == lookback:
return i + lookback
def solve(inputstr):
print(f"Part 1: {scan(inputstr, 4)}")
print(f"Part 2: {scan(inputstr, 14)}")