Move Python solutions
This commit is contained in:
parent
6fae773051
commit
2f1872bbd9
255 changed files with 0 additions and 4323 deletions
20
Python/2022/06.py
Normal file
20
Python/2022/06.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
def get_input(puzzle: str) -> str:
|
||||
return puzzle
|
||||
|
||||
|
||||
def part1(puzzle: str):
|
||||
for i in range(4, len(puzzle)):
|
||||
if len(set(puzzle[i - 4 : i])) == 4:
|
||||
return i
|
||||
|
||||
|
||||
def part2(puzzle: str):
|
||||
for i in range(14, len(puzzle)):
|
||||
if len(set(puzzle[i - 14 : i])) == 14:
|
||||
return i
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from aoc import run
|
||||
|
||||
run(2022, 6, part1, part2)
|
Loading…
Add table
Add a link
Reference in a new issue