fork(1) download
  1. f=lambda m,a=-1:m and m.pop(0)[::a]+f(m,-a)
  2.  
  3. print(f([]))
  4. print(f([[1]]))
  5. print(f([[2, 1], [3, 4]]))
  6. print(f([[3, 2, 1], [4, 5, 6], [9, 8, 7]]))
  7. print(f([[4, 3, 2, 1], [5, 6, 7, 8], [12, 11, 10, 9], [13, 14, 15, 16]]))
Success #stdin #stdout 0.01s 27712KB
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]