Hey Chris, I made a replica of your solution translated to Python3.5 or greater.
from itertools import chain def snail(arr): mid = list(map(lambda row : row[slice(1, len(row)-1)], arr[slice(1,len(arr)-1)])) return list(chain.from_iterable([ arr[0], list(map(lambda row: row[len(row)-1], arr[slice(1,len(arr)-1)])), list(reversed(arr[len(arr)-1])) if len(arr) > 1 else [], list(map(lambda row: row[0],list(reversed(arr[slice(1,len(arr)-1)])))), snail(mid) if len(mid) > 0 else [] ]))if len(arr) >= 1 else [[]]
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey Chris, I made a replica of your solution translated to Python3.5 or greater.