Compare commits
No commits in common. "codewars" and "uebung1" have entirely different histories.
@ -1,24 +0,0 @@
|
||||
def snail(snail_map):
|
||||
result = []
|
||||
if not snail_map or not snail_map[0]:
|
||||
return result
|
||||
|
||||
while snail_map:
|
||||
result += snail_map.pop(0)
|
||||
|
||||
if snail_map and snail_map[0]:
|
||||
for row in snail_map:
|
||||
result.append(row.pop())
|
||||
|
||||
if snail_map:
|
||||
result += snail_map.pop()[::-1]
|
||||
|
||||
if snail_map and snail_map[0]:
|
||||
for row in reversed(snail_map):
|
||||
result.append(row.pop(0))
|
||||
|
||||
return result
|
||||
|
||||
|
||||
# https://www.codewars.com/kata/521c2db8ddc89b9b7a0000c1/train/python
|
||||
# ich kam nicht selbstständig auf diese lösung. Könntes du mir diese erklären? ich dachte pop löscht.
|
||||
Loading…
x
Reference in New Issue
Block a user