23 lines
350 B
Python
23 lines
350 B
Python
# Python!
|
|
|
|
with open('03.txt') as file:
|
|
sets = file.read().splitlines()
|
|
|
|
grid = []
|
|
vgroups = []
|
|
for i, s in enumerate(sets):
|
|
set = [int(n) for n in s.split()]
|
|
grid.append(set)
|
|
|
|
if len(grid) == 3:
|
|
[vgroups.append(list(g)) for g in zip(*grid)]
|
|
grid = []
|
|
|
|
count = 0
|
|
for s in vgroups:
|
|
s.sort()
|
|
if s[0] + s[1] > s[2]:
|
|
count += 1
|
|
|
|
print(count)
|