pop from copy
This commit is contained in:
parent
ef08f0d23a
commit
bb15842353
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import copy
|
||||||
|
|
||||||
test = (""" [D]
|
test = (""" [D]
|
||||||
[N] [C]
|
[N] [C]
|
||||||
|
@ -38,7 +39,8 @@ def rearrange_stacks( input ):
|
||||||
return stack
|
return stack
|
||||||
|
|
||||||
def read_stacks_top( stacks ):
|
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))
|
print("".join(top))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import copy
|
||||||
|
|
||||||
test = (""" [D]
|
test = (""" [D]
|
||||||
[N] [C]
|
[N] [C]
|
||||||
|
@ -38,7 +39,8 @@ def rearrange_stacks( input ):
|
||||||
return stack
|
return stack
|
||||||
|
|
||||||
def read_stacks_top( stacks ):
|
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))
|
print("".join(top))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue