Day 06 (minified)

This commit is contained in:
Sebastian Seedorf
2022-12-08 11:33:21 +01:00
parent c476f87437
commit b61471f365
3 changed files with 3 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ for line in lines:
next(lines)
for line in lines:
a, s, t = map(int, re.search(r"move (\d+) from (\d+) to (\d+)", line).groups())
stacks[t-1] = stacks[s-1][:a][::-1]+stacks[t-1]
stacks[t-1] = stacks[s-1][:a]+stacks[t-1]
stacks[s-1] = stacks[s-1][a:]
print(''.join(i[0] for i in stacks))