pop from copy

This commit is contained in:
Steven Wilson 2022-12-07 17:20:25 +00:00
parent ef08f0d23a
commit bb15842353
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import re
import copy
test = (""" [D]
[N] [C]
@ -38,7 +39,8 @@ def rearrange_stacks( input ):
return stack
def read_stacks_top( stacks ):
top = list(map(list.pop, stacks))
stacks_c = copy.deepcopy(stacks)
top = list(map(list.pop, stacks_c))
print("".join(top))

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import re
import copy
test = (""" [D]
[N] [C]
@ -38,7 +39,8 @@ def rearrange_stacks( input ):
return stack
def read_stacks_top( stacks ):
top = list(map(list.pop, stacks))
stacks_c = copy.deepcopy(stacks)
top = list(map(list.pop, stacks_c))
print("".join(top))