retyped day2, completed days 3 and 4, modified template

This commit is contained in:
2024-12-01 16:19:37 +01:00
parent 42bab0cb9e
commit 9e21d8d9c8
12 changed files with 134 additions and 26 deletions

13
day4/part2.py Normal file
View File

@@ -0,0 +1,13 @@
from common import Range, parse
def solve(input: list[tuple[Range, Range]]) -> int:
return len(list(filter(lambda x: x[0].overlaps_with(x[1]) or x[1].overlaps_with(x[0]), input)))
def main():
print(solve(parse("input")))
if __name__ == "__main__":
main()