fork(2) download
  1. f=lambda m:m and m.pop(0)+f([list(x)for x in zip(*m)][::-1])
  2.  
  3. print(f([]))
  4. print(f([[1]]))
  5. print(f([[1,2],[4,3]]))
  6. print(f([[1,2,3],[8,9,4],[7,6,5]]))
  7. print(f([[1,2,3,4],[12,13,14,5],[11,16,15,6],[10,9,8,7]]))
  8. print(f([[1,2,3,4],[10,11,12,5],[9,8,7,6]]))
Success #stdin #stdout 0.01s 23296KB
stdin
Standard input is empty
stdout
[]
[1]
[1, 2, 3, 4]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]