Skip to content

Commit 817469b

Browse files
committed
simplified
1 parent 289388d commit 817469b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

2022/05.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@ def solve(stacks, lines, step=1):
88

99

1010
data, lines = open(0).read().split("\n\n")
11-
# fmt:off
1211
stacks = [
1312
"".join(column).rstrip()
1413
for i, column in enumerate(zip(*data.splitlines()[-2::-1]))
15-
if i % 4 == 1
14+
if i % 4 == 1
1615
]
1716
lines = [
1817
(int(line[1]), int(line[3]) - 1, int(line[5]) - 1)
1918
for line in map(str.split, lines.splitlines())
2019
]
21-
# fmt:on
20+
2221
print(solve(stacks.copy(), lines, -1))
2322
print(solve(stacks.copy(), lines))

0 commit comments

Comments
 (0)