Compare commits
3 Commits
d1b96f1324
...
2b3187a416
Author | SHA1 | Date |
---|---|---|
magical | 2b3187a416 | |
magical | d6333ce7e8 | |
magical | e7afa95c6d |
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,20 @@
|
|||
|
||||
sample = 6 4 rho 2 4 6 8 2 3 4 5 5 7 7 9 2 8 3 7 6 6 4 6 2 6 4 8
|
||||
) get "input.ivy"
|
||||
|
||||
op r overlaps s = not (r[2] < s[1]) or (s[2] < r[1])
|
||||
op r contains s = (r[1] <= s[1]) and (s[2] <= r[2])
|
||||
|
||||
op contains x = (x[1 2] contains x[3 4]) or (x[3 4] contains x[1 2])
|
||||
op overlaps x = (x[1 2] overlaps x[3 4])
|
||||
|
||||
#1 3 overlaps 4 5 # -> 0
|
||||
#1 5 overlaps 2 7 # -> 1
|
||||
#contains 1 2 3 4 # -> 0
|
||||
#contains 5 10 7 8 # -> 1
|
||||
|
||||
+/ contains transp sample
|
||||
+/ contains transp input
|
||||
|
||||
+/ overlaps transp sample
|
||||
+/ overlaps transp input
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
Converts a text file containing a list of integers
|
||||
into a format that can be loaded by ivy.
|
||||
"""
|
||||
|
||||
with open("input") as f:
|
||||
lines = f.read().splitlines()
|
||||
|
||||
data = []
|
||||
for line in lines:
|
||||
line = line.replace("-", ",")
|
||||
data.append(line.split(","))
|
||||
|
||||
def count(row):
|
||||
n = 0
|
||||
for x in row:
|
||||
if x.isdigit():
|
||||
n += 1
|
||||
else:
|
||||
n += len(x)
|
||||
return n
|
||||
|
||||
cols = max(map(count, data))
|
||||
|
||||
print("input = {} {} rho".format(len(data), cols), end="")
|
||||
for row in data:
|
||||
print("", " ".join(
|
||||
x if x.isdigit() else repr(x)
|
||||
for x in row), end="")
|
||||
n = count(row)
|
||||
if n < cols:
|
||||
print(" 0" * (cols - n), end="")
|
|
@ -0,0 +1,512 @@
|
|||
[H] [D] [P]
|
||||
[W] [B] [C] [Z] [D]
|
||||
[T] [J] [T] [J] [D] [J]
|
||||
[H] [Z] [H] [H] [W] [S] [M]
|
||||
[P] [F] [R] [P] [Z] [F] [W] [F]
|
||||
[J] [V] [T] [N] [F] [G] [Z] [S] [S]
|
||||
[C] [R] [P] [S] [V] [M] [V] [D] [Z]
|
||||
[F] [G] [H] [Z] [N] [P] [M] [N] [D]
|
||||
1 2 3 4 5 6 7 8 9
|
||||
|
||||
move 2 from 8 to 2
|
||||
move 3 from 9 to 2
|
||||
move 1 from 3 to 8
|
||||
move 5 from 1 to 7
|
||||
move 2 from 9 to 2
|
||||
move 8 from 2 to 4
|
||||
move 6 from 7 to 2
|
||||
move 2 from 1 to 7
|
||||
move 4 from 5 to 9
|
||||
move 4 from 5 to 6
|
||||
move 1 from 8 to 3
|
||||
move 1 from 8 to 5
|
||||
move 2 from 9 to 8
|
||||
move 8 from 6 to 4
|
||||
move 4 from 3 to 6
|
||||
move 10 from 2 to 3
|
||||
move 1 from 5 to 1
|
||||
move 1 from 7 to 4
|
||||
move 2 from 9 to 8
|
||||
move 18 from 4 to 8
|
||||
move 1 from 1 to 6
|
||||
move 4 from 7 to 3
|
||||
move 12 from 8 to 4
|
||||
move 4 from 7 to 9
|
||||
move 5 from 6 to 9
|
||||
move 2 from 2 to 7
|
||||
move 3 from 9 to 5
|
||||
move 3 from 5 to 9
|
||||
move 1 from 2 to 8
|
||||
move 10 from 3 to 1
|
||||
move 2 from 7 to 8
|
||||
move 10 from 1 to 9
|
||||
move 1 from 3 to 5
|
||||
move 16 from 9 to 8
|
||||
move 1 from 3 to 2
|
||||
move 3 from 8 to 3
|
||||
move 1 from 5 to 9
|
||||
move 3 from 6 to 7
|
||||
move 2 from 7 to 2
|
||||
move 1 from 3 to 8
|
||||
move 5 from 4 to 1
|
||||
move 4 from 9 to 5
|
||||
move 2 from 2 to 5
|
||||
move 2 from 1 to 9
|
||||
move 23 from 8 to 4
|
||||
move 6 from 5 to 2
|
||||
move 5 from 2 to 6
|
||||
move 1 from 9 to 6
|
||||
move 2 from 2 to 4
|
||||
move 35 from 4 to 9
|
||||
move 1 from 6 to 1
|
||||
move 2 from 8 to 7
|
||||
move 1 from 6 to 8
|
||||
move 3 from 1 to 7
|
||||
move 1 from 7 to 1
|
||||
move 3 from 6 to 2
|
||||
move 4 from 3 to 7
|
||||
move 6 from 7 to 9
|
||||
move 1 from 6 to 9
|
||||
move 1 from 8 to 1
|
||||
move 2 from 2 to 9
|
||||
move 2 from 8 to 2
|
||||
move 3 from 7 to 3
|
||||
move 2 from 1 to 9
|
||||
move 5 from 9 to 3
|
||||
move 1 from 4 to 2
|
||||
move 1 from 1 to 4
|
||||
move 7 from 3 to 9
|
||||
move 1 from 3 to 4
|
||||
move 2 from 4 to 7
|
||||
move 24 from 9 to 4
|
||||
move 12 from 9 to 3
|
||||
move 1 from 3 to 1
|
||||
move 1 from 1 to 2
|
||||
move 2 from 2 to 6
|
||||
move 1 from 6 to 5
|
||||
move 1 from 6 to 8
|
||||
move 3 from 2 to 4
|
||||
move 1 from 7 to 4
|
||||
move 1 from 5 to 3
|
||||
move 1 from 9 to 8
|
||||
move 23 from 4 to 8
|
||||
move 17 from 8 to 5
|
||||
move 12 from 9 to 8
|
||||
move 10 from 8 to 7
|
||||
move 1 from 8 to 6
|
||||
move 5 from 4 to 3
|
||||
move 3 from 5 to 1
|
||||
move 3 from 1 to 6
|
||||
move 6 from 5 to 4
|
||||
move 10 from 3 to 1
|
||||
move 9 from 1 to 7
|
||||
move 2 from 4 to 9
|
||||
move 1 from 1 to 6
|
||||
move 4 from 8 to 1
|
||||
move 4 from 3 to 7
|
||||
move 4 from 6 to 5
|
||||
move 1 from 9 to 6
|
||||
move 1 from 9 to 2
|
||||
move 1 from 1 to 7
|
||||
move 1 from 2 to 7
|
||||
move 3 from 1 to 7
|
||||
move 9 from 5 to 9
|
||||
move 7 from 9 to 7
|
||||
move 2 from 9 to 1
|
||||
move 3 from 5 to 9
|
||||
move 3 from 4 to 8
|
||||
move 1 from 1 to 2
|
||||
move 1 from 2 to 6
|
||||
move 1 from 1 to 6
|
||||
move 5 from 8 to 7
|
||||
move 1 from 8 to 1
|
||||
move 1 from 3 to 9
|
||||
move 1 from 1 to 6
|
||||
move 2 from 9 to 5
|
||||
move 2 from 3 to 9
|
||||
move 4 from 6 to 3
|
||||
move 1 from 9 to 4
|
||||
move 2 from 4 to 8
|
||||
move 1 from 4 to 8
|
||||
move 1 from 9 to 5
|
||||
move 1 from 6 to 8
|
||||
move 23 from 7 to 8
|
||||
move 27 from 8 to 2
|
||||
move 2 from 8 to 1
|
||||
move 23 from 2 to 6
|
||||
move 3 from 5 to 3
|
||||
move 4 from 2 to 5
|
||||
move 2 from 3 to 1
|
||||
move 2 from 9 to 3
|
||||
move 4 from 1 to 4
|
||||
move 13 from 7 to 9
|
||||
move 1 from 5 to 6
|
||||
move 2 from 5 to 9
|
||||
move 1 from 5 to 3
|
||||
move 3 from 9 to 3
|
||||
move 5 from 9 to 5
|
||||
move 2 from 4 to 2
|
||||
move 1 from 4 to 9
|
||||
move 11 from 6 to 9
|
||||
move 9 from 6 to 1
|
||||
move 17 from 9 to 5
|
||||
move 3 from 7 to 4
|
||||
move 3 from 6 to 3
|
||||
move 14 from 5 to 2
|
||||
move 5 from 3 to 1
|
||||
move 2 from 9 to 4
|
||||
move 2 from 3 to 8
|
||||
move 5 from 5 to 9
|
||||
move 2 from 5 to 4
|
||||
move 7 from 1 to 8
|
||||
move 2 from 9 to 5
|
||||
move 3 from 9 to 8
|
||||
move 8 from 4 to 2
|
||||
move 2 from 7 to 8
|
||||
move 10 from 2 to 9
|
||||
move 10 from 2 to 6
|
||||
move 8 from 9 to 7
|
||||
move 2 from 3 to 9
|
||||
move 3 from 9 to 8
|
||||
move 5 from 3 to 9
|
||||
move 7 from 7 to 9
|
||||
move 3 from 2 to 9
|
||||
move 10 from 8 to 5
|
||||
move 1 from 7 to 6
|
||||
move 1 from 2 to 3
|
||||
move 4 from 1 to 6
|
||||
move 2 from 8 to 4
|
||||
move 1 from 4 to 6
|
||||
move 2 from 6 to 3
|
||||
move 2 from 3 to 1
|
||||
move 1 from 4 to 9
|
||||
move 4 from 1 to 5
|
||||
move 2 from 5 to 2
|
||||
move 2 from 8 to 4
|
||||
move 1 from 3 to 5
|
||||
move 3 from 5 to 7
|
||||
move 2 from 2 to 9
|
||||
move 3 from 7 to 6
|
||||
move 3 from 8 to 5
|
||||
move 10 from 5 to 7
|
||||
move 3 from 6 to 4
|
||||
move 11 from 6 to 1
|
||||
move 3 from 6 to 2
|
||||
move 12 from 1 to 3
|
||||
move 1 from 7 to 5
|
||||
move 9 from 7 to 3
|
||||
move 5 from 5 to 1
|
||||
move 4 from 4 to 6
|
||||
move 2 from 1 to 7
|
||||
move 1 from 2 to 6
|
||||
move 2 from 7 to 8
|
||||
move 1 from 2 to 4
|
||||
move 1 from 9 to 5
|
||||
move 3 from 6 to 7
|
||||
move 1 from 5 to 2
|
||||
move 9 from 9 to 5
|
||||
move 1 from 2 to 8
|
||||
move 1 from 4 to 8
|
||||
move 1 from 1 to 8
|
||||
move 1 from 4 to 2
|
||||
move 1 from 7 to 2
|
||||
move 1 from 6 to 2
|
||||
move 1 from 6 to 8
|
||||
move 6 from 9 to 6
|
||||
move 1 from 3 to 4
|
||||
move 9 from 3 to 5
|
||||
move 1 from 1 to 3
|
||||
move 2 from 2 to 6
|
||||
move 1 from 3 to 5
|
||||
move 14 from 5 to 1
|
||||
move 1 from 2 to 6
|
||||
move 5 from 6 to 4
|
||||
move 3 from 8 to 2
|
||||
move 5 from 6 to 1
|
||||
move 5 from 4 to 6
|
||||
move 1 from 7 to 1
|
||||
move 3 from 9 to 3
|
||||
move 7 from 5 to 7
|
||||
move 1 from 4 to 6
|
||||
move 2 from 7 to 5
|
||||
move 3 from 6 to 1
|
||||
move 3 from 8 to 1
|
||||
move 14 from 3 to 4
|
||||
move 8 from 4 to 2
|
||||
move 1 from 6 to 1
|
||||
move 15 from 1 to 6
|
||||
move 7 from 1 to 6
|
||||
move 6 from 1 to 3
|
||||
move 3 from 3 to 1
|
||||
move 2 from 4 to 5
|
||||
move 1 from 4 to 2
|
||||
move 19 from 6 to 8
|
||||
move 2 from 1 to 8
|
||||
move 4 from 5 to 4
|
||||
move 7 from 8 to 2
|
||||
move 2 from 3 to 1
|
||||
move 13 from 8 to 6
|
||||
move 4 from 4 to 9
|
||||
move 2 from 4 to 8
|
||||
move 2 from 1 to 6
|
||||
move 1 from 3 to 5
|
||||
move 19 from 2 to 3
|
||||
move 13 from 3 to 1
|
||||
move 1 from 4 to 9
|
||||
move 1 from 2 to 8
|
||||
move 3 from 7 to 1
|
||||
move 14 from 6 to 9
|
||||
move 2 from 6 to 4
|
||||
move 18 from 9 to 4
|
||||
move 3 from 7 to 2
|
||||
move 15 from 1 to 4
|
||||
move 2 from 1 to 8
|
||||
move 5 from 3 to 1
|
||||
move 1 from 3 to 6
|
||||
move 5 from 8 to 9
|
||||
move 3 from 9 to 5
|
||||
move 1 from 9 to 5
|
||||
move 1 from 8 to 9
|
||||
move 1 from 6 to 2
|
||||
move 3 from 9 to 4
|
||||
move 2 from 6 to 7
|
||||
move 30 from 4 to 6
|
||||
move 22 from 6 to 9
|
||||
move 6 from 9 to 4
|
||||
move 4 from 6 to 7
|
||||
move 1 from 1 to 6
|
||||
move 1 from 9 to 8
|
||||
move 1 from 7 to 6
|
||||
move 3 from 5 to 3
|
||||
move 5 from 6 to 5
|
||||
move 2 from 7 to 9
|
||||
move 4 from 1 to 5
|
||||
move 1 from 6 to 4
|
||||
move 1 from 8 to 7
|
||||
move 2 from 6 to 4
|
||||
move 17 from 9 to 8
|
||||
move 2 from 2 to 7
|
||||
move 2 from 3 to 1
|
||||
move 8 from 4 to 8
|
||||
move 1 from 3 to 8
|
||||
move 8 from 4 to 2
|
||||
move 2 from 1 to 2
|
||||
move 1 from 4 to 6
|
||||
move 4 from 7 to 1
|
||||
move 1 from 6 to 8
|
||||
move 19 from 8 to 3
|
||||
move 5 from 5 to 1
|
||||
move 5 from 5 to 9
|
||||
move 2 from 9 to 3
|
||||
move 6 from 1 to 9
|
||||
move 1 from 7 to 5
|
||||
move 1 from 7 to 4
|
||||
move 2 from 5 to 7
|
||||
move 2 from 2 to 4
|
||||
move 4 from 9 to 8
|
||||
move 12 from 8 to 7
|
||||
move 2 from 1 to 9
|
||||
move 1 from 7 to 4
|
||||
move 4 from 4 to 5
|
||||
move 3 from 9 to 3
|
||||
move 9 from 2 to 6
|
||||
move 2 from 7 to 5
|
||||
move 1 from 1 to 9
|
||||
move 5 from 9 to 7
|
||||
move 9 from 6 to 2
|
||||
move 6 from 2 to 8
|
||||
move 21 from 3 to 2
|
||||
move 12 from 2 to 9
|
||||
move 3 from 5 to 9
|
||||
move 3 from 3 to 8
|
||||
move 5 from 9 to 6
|
||||
move 13 from 2 to 3
|
||||
move 3 from 6 to 2
|
||||
move 10 from 9 to 8
|
||||
move 6 from 3 to 1
|
||||
move 3 from 2 to 9
|
||||
move 2 from 6 to 7
|
||||
move 5 from 3 to 9
|
||||
move 4 from 1 to 9
|
||||
move 3 from 8 to 5
|
||||
move 1 from 1 to 7
|
||||
move 6 from 5 to 7
|
||||
move 12 from 9 to 7
|
||||
move 1 from 1 to 8
|
||||
move 11 from 8 to 5
|
||||
move 9 from 5 to 7
|
||||
move 1 from 3 to 1
|
||||
move 4 from 8 to 7
|
||||
move 1 from 1 to 7
|
||||
move 2 from 8 to 3
|
||||
move 42 from 7 to 4
|
||||
move 3 from 7 to 9
|
||||
move 4 from 7 to 5
|
||||
move 1 from 7 to 8
|
||||
move 1 from 8 to 5
|
||||
move 1 from 7 to 5
|
||||
move 1 from 3 to 4
|
||||
move 1 from 3 to 9
|
||||
move 1 from 9 to 6
|
||||
move 1 from 6 to 4
|
||||
move 1 from 3 to 5
|
||||
move 3 from 9 to 2
|
||||
move 16 from 4 to 8
|
||||
move 3 from 2 to 4
|
||||
move 1 from 5 to 4
|
||||
move 30 from 4 to 6
|
||||
move 15 from 8 to 3
|
||||
move 2 from 4 to 5
|
||||
move 1 from 8 to 7
|
||||
move 13 from 3 to 6
|
||||
move 1 from 7 to 8
|
||||
move 1 from 3 to 8
|
||||
move 1 from 3 to 8
|
||||
move 4 from 5 to 2
|
||||
move 6 from 5 to 2
|
||||
move 2 from 8 to 6
|
||||
move 43 from 6 to 2
|
||||
move 1 from 6 to 1
|
||||
move 18 from 2 to 4
|
||||
move 24 from 2 to 6
|
||||
move 19 from 6 to 3
|
||||
move 4 from 6 to 3
|
||||
move 2 from 6 to 3
|
||||
move 3 from 3 to 2
|
||||
move 1 from 1 to 3
|
||||
move 23 from 3 to 6
|
||||
move 12 from 4 to 3
|
||||
move 7 from 3 to 9
|
||||
move 13 from 2 to 9
|
||||
move 1 from 8 to 4
|
||||
move 4 from 3 to 8
|
||||
move 6 from 4 to 2
|
||||
move 10 from 9 to 3
|
||||
move 6 from 2 to 9
|
||||
move 8 from 3 to 5
|
||||
move 3 from 5 to 3
|
||||
move 13 from 6 to 5
|
||||
move 4 from 3 to 9
|
||||
move 1 from 4 to 2
|
||||
move 4 from 8 to 3
|
||||
move 1 from 2 to 5
|
||||
move 14 from 9 to 5
|
||||
move 2 from 5 to 4
|
||||
move 2 from 4 to 3
|
||||
move 1 from 9 to 5
|
||||
move 4 from 6 to 1
|
||||
move 1 from 6 to 2
|
||||
move 6 from 3 to 2
|
||||
move 5 from 6 to 8
|
||||
move 2 from 3 to 7
|
||||
move 1 from 8 to 1
|
||||
move 25 from 5 to 7
|
||||
move 3 from 7 to 9
|
||||
move 5 from 2 to 9
|
||||
move 12 from 9 to 8
|
||||
move 3 from 1 to 6
|
||||
move 16 from 8 to 2
|
||||
move 1 from 9 to 2
|
||||
move 1 from 6 to 2
|
||||
move 1 from 1 to 3
|
||||
move 21 from 7 to 3
|
||||
move 2 from 7 to 1
|
||||
move 1 from 7 to 8
|
||||
move 2 from 2 to 1
|
||||
move 2 from 6 to 3
|
||||
move 18 from 2 to 9
|
||||
move 2 from 5 to 1
|
||||
move 1 from 2 to 1
|
||||
move 3 from 5 to 2
|
||||
move 13 from 9 to 1
|
||||
move 3 from 9 to 2
|
||||
move 1 from 8 to 7
|
||||
move 3 from 2 to 6
|
||||
move 2 from 5 to 1
|
||||
move 17 from 3 to 8
|
||||
move 3 from 3 to 8
|
||||
move 2 from 9 to 1
|
||||
move 1 from 7 to 5
|
||||
move 1 from 5 to 3
|
||||
move 2 from 6 to 4
|
||||
move 1 from 6 to 1
|
||||
move 15 from 8 to 2
|
||||
move 2 from 3 to 6
|
||||
move 1 from 8 to 5
|
||||
move 2 from 6 to 8
|
||||
move 13 from 2 to 9
|
||||
move 4 from 9 to 8
|
||||
move 9 from 8 to 9
|
||||
move 3 from 3 to 4
|
||||
move 4 from 9 to 7
|
||||
move 1 from 8 to 6
|
||||
move 1 from 7 to 5
|
||||
move 2 from 5 to 1
|
||||
move 1 from 6 to 3
|
||||
move 4 from 4 to 5
|
||||
move 1 from 4 to 6
|
||||
move 1 from 3 to 7
|
||||
move 1 from 5 to 6
|
||||
move 2 from 7 to 2
|
||||
move 4 from 2 to 3
|
||||
move 3 from 2 to 7
|
||||
move 1 from 3 to 6
|
||||
move 1 from 9 to 6
|
||||
move 2 from 5 to 2
|
||||
move 3 from 9 to 5
|
||||
move 1 from 6 to 1
|
||||
move 3 from 5 to 4
|
||||
move 12 from 1 to 2
|
||||
move 2 from 2 to 4
|
||||
move 2 from 7 to 8
|
||||
move 2 from 3 to 9
|
||||
move 1 from 4 to 7
|
||||
move 1 from 5 to 2
|
||||
move 1 from 8 to 3
|
||||
move 2 from 3 to 6
|
||||
move 7 from 2 to 8
|
||||
move 3 from 4 to 1
|
||||
move 7 from 8 to 5
|
||||
move 7 from 9 to 2
|
||||
move 1 from 4 to 5
|
||||
move 3 from 7 to 6
|
||||
move 5 from 6 to 9
|
||||
move 6 from 9 to 5
|
||||
move 4 from 9 to 6
|
||||
move 1 from 8 to 5
|
||||
move 1 from 7 to 4
|
||||
move 1 from 4 to 2
|
||||
move 2 from 2 to 9
|
||||
move 2 from 9 to 2
|
||||
move 11 from 5 to 3
|
||||
move 2 from 5 to 2
|
||||
move 1 from 2 to 9
|
||||
move 4 from 6 to 9
|
||||
move 1 from 2 to 9
|
||||
move 4 from 3 to 7
|
||||
move 3 from 6 to 4
|
||||
move 1 from 5 to 7
|
||||
move 18 from 1 to 3
|
||||
move 11 from 3 to 2
|
||||
move 1 from 7 to 9
|
||||
move 1 from 5 to 9
|
||||
move 14 from 3 to 6
|
||||
move 15 from 2 to 4
|
||||
move 5 from 2 to 5
|
||||
move 1 from 2 to 5
|
||||
move 1 from 1 to 9
|
||||
move 8 from 4 to 1
|
||||
move 5 from 5 to 9
|
||||
move 9 from 4 to 9
|
||||
move 4 from 7 to 4
|
||||
move 5 from 4 to 8
|
||||
move 2 from 9 to 6
|
||||
move 8 from 1 to 8
|
||||
move 1 from 5 to 3
|
||||
move 1 from 3 to 4
|
||||
move 1 from 1 to 8
|
||||
move 13 from 6 to 3
|
||||
move 9 from 9 to 5
|
||||
move 1 from 2 to 8
|
||||
move 8 from 5 to 1
|
||||
move 1 from 2 to 7
|
|
@ -0,0 +1,41 @@
|
|||
import sys
|
||||
|
||||
with open("input") as f:
|
||||
data = f.read()
|
||||
a, b = data.split("\n\n")
|
||||
stacks = [
|
||||
"FCJPHTW",
|
||||
"GRVFZJBH",
|
||||
"HPTR",
|
||||
"ZSNPHT",
|
||||
"NVFZHJCD",
|
||||
"PMGFWDZ",
|
||||
"MVZWSJDP",
|
||||
"NDS",
|
||||
"DZSFM",
|
||||
]
|
||||
ins = b.splitlines()
|
||||
|
||||
stacks1 = [list(x) for x in stacks]
|
||||
stacks2 = [list(x) for x in stacks]
|
||||
|
||||
for i in ins:
|
||||
#print(i)
|
||||
_, n, _, f, _, t = i.split()
|
||||
n = int(n)
|
||||
f = int(f)
|
||||
t = int(t)
|
||||
|
||||
# part 1
|
||||
for _ in range(n):
|
||||
#print(stacks1[t-1])
|
||||
#print(stacks1[f-1])
|
||||
stacks1[t-1].append(stacks1[f-1].pop())
|
||||
|
||||
# part 2
|
||||
stacks2[t-1].extend(stacks2[f-1][-n:])
|
||||
stacks2[f-1] = stacks2[f-1][:-n]
|
||||
|
||||
print("".join(x[-1] for x in stacks1))
|
||||
print("".join(x[-1] for x in stacks2))
|
||||
|
Loading…
Reference in New Issue