[Python/2016] Move solutions into .py files

This commit is contained in:
Felix Bargfeldt 2023-10-29 12:38:12 +01:00
parent 0269ad8fc3
commit 2514b1d11f
Signed by: Defelo
GPG key ID: 2A05272471204DD3
50 changed files with 1172 additions and 3386 deletions

13
Python/2016/03.py Normal file
View file

@ -0,0 +1,13 @@
from lib import *
input = read_input(2016, 3)
print(sum((y := sorted(map(int, x)))[2] < y[0] + y[1] for x in map(str.split, input.splitlines())))
triangles = [int(b) for a in zip(*map(str.split, input.splitlines())) for b in a]
out = 0
while triangles:
a, b, c = sorted([triangles.pop(0) for _ in "xxx"])
out += c < a + b
print(out)