aoc2017/day04.py
2022-11-19 21:22:35 +01:00

34 lines
670 B
Python

from tools.aoc import AOCDay
from typing import Any
class Day(AOCDay):
inputs = [
[
(451, "input4")
],
[
(223, "input4")
]
]
def part1(self) -> Any:
i = 0
for x in self.getInput():
if len(x.split(" ")) == len(set(x.split(" "))):
i += 1
return i
def part2(self) -> Any:
i = 0
for x in self.getInput():
bla = ["".join(sorted(foo)) for foo in x.split(" ")]
if len(bla) == len(set(bla)):
i += 1
return i
if __name__ == '__main__':
day = Day(2017, 4)
day.run(verbose=True)