aboutsummaryrefslogtreecommitdiff
path: root/2025/06/a.py
diff options
context:
space:
mode:
Diffstat (limited to '2025/06/a.py')
-rw-r--r--2025/06/a.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/2025/06/a.py b/2025/06/a.py
index 1d12e01..c9707ab 100644
--- a/2025/06/a.py
+++ b/2025/06/a.py
@@ -13,8 +13,7 @@ with fileinput.input() as lines:
13 a.append([int(x) for x in t if x != '']) 13 a.append([int(x) for x in t if x != ''])
14 14
15def sol(a, op, i): 15def sol(a, op, i):
16 return (sum(a[j][i] for j in range(len(a))) if op[i] == '+' 16 col = [a[j][i] for j in range(len(a))]
17 else reduce(mul, (a[j][i] for j in range(len(a))), 1)) 17 return sum(col) if op[i] == '+' else reduce(mul, col, 1)
18
19 18
20print(sum(sol(a, op, i) for i in range(len(a[0])))) 19print(sum(sol(a, op, i) for i in range(len(a[0]))))

Generated with cgit - Back to sebastiano.tronto.net