Move Python solutions

This commit is contained in:
Felix Bargfeldt 2023-10-19 22:06:58 +02:00
parent 6fae773051
commit 2f1872bbd9
Signed by: Defelo
GPG key ID: 2A05272471204DD3
255 changed files with 0 additions and 4323 deletions

15
Python/2022/04.py Normal file
View file

@ -0,0 +1,15 @@
from utils.parsing import pints
def part1(puzzle: str):
return sum(a <= c <= d <= b or c <= a <= b <= d for a, b, c, d in map(pints, puzzle.splitlines()))
def part2(puzzle: str):
return sum(d >= a and c <= b for a, b, c, d in map(pints, puzzle.splitlines()))
if __name__ == "__main__":
from aoc import run
run(2022, 4, part1, part2)