[Question]
  [
Given a matrix, output a representation of the matrix where the top left element is on top, the anti-diagonal is the central row and the bottom right element is at the bottom.
For example, consider the following matrix:
```
1 2 3
4 5 6
7 8 9
```
The diamond version of this matrix is:
```
  1
 4 2
7 5 3
 8 6
  9
```
### Inputs and outputs
An input matrix will be given as a list of lists (or anything similar in your language of choice). The output shall be a list of lists as well.
The matrices will only contain positive integers.
The input matrix will not necessarily be square.
The input matrix will be at least 1×1.
### Test Cases
```
Input:  [[1]]
Output: [[1]]
Input:  [[1,2],[3,4]]
Output: [[1],[3,2],[4]]
Input:  [[1,2,3],[4,5,6]]
Output: [[1],[4,2],[5,3],[6]]
Input:  [[11,2,5],[3,99,3],[4,8,15],[16,23,42]]
Output: [[11],[3,2],[4,99,5],[16,8,3],[23,15],[42]]
```
### Scoring
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest answer in bytes wins.
  
[Answer]
## J, 6 bytes
```
<@|./.
```
This is an unnamed a monadic verb which takes a matrix and returns a list of antidiagonals:
```
   input =. i.3 4
   input
0 1  2  3
4 5  6  7
8 9 10 11
   <@|./. input
┌─┬───┬─────┬─────┬────┬──┐
│0│4 1│8 5 2│9 6 3│10 7│11│
└─┴───┴─────┴─────┴────┴──┘
```
[Test it here.](http://tryj.tk/)
### Explanation
* `/.` is J's built-in to apply a function to each anti-diagonal. Unfortunately, these anti-diagonals are given in the opposite order of what we want here.
* In `<@|.`, we first apply `|.` which reverses the anti-diagonal and then `<` to box it (which is the only way to return a ragged array in J, since normal arrays are always rectangular, so the antidiagonals would be padded with zeroes).
[Answer]
# Python, 91 bytes
```
e=enumerate
lambda M:[[r[n-i]for i,r in e(M)if-1<n-i<len(r)][::-1]for n,_ in e(M[1:]+M[0])]
```
Test it on [Ideone](http://ideone.com/FjgmK4).
---
# Python + NumPy, 69 bytes
```
import numpy
lambda M:map(M[::-1].diagonal,range(1-len(M),len(M[0])))
```
Expects a 2D NumPy array as input and returns a list of NumPy arrays. Test it on [Ideone](http://ideone.com/kFQIgU).
[Answer]
## Jelly, 7 bytes
```
ṚŒDṙZL$
```
[Try it online!](http://jelly.tryitonline.net/#code=4bmaxZJE4bmZWkwk&input=&args=W1swLCAxLCAyLCAzXSwgWzQsIDUsIDYsIDddLCBbOCwgOSwgMTAsIDExXV0)
### Explanation
```
Ṛ         Reverse the matrix vertically.
 ŒD       Get its diagonals. However these start from 
          the main diagonal, not the corners.
    ZL$   Get the width of the input matrix.
   ṙ      Rotate the list of diagonals left by that many 
          places to obtain the correct order.
```
[Answer]
# Mathematica, ~~58~~ 56 bytes
```
a=Length;Reverse@#~Diagonal~b~Table~{b,1-a@#,a@#&@@#-1}&
```
Anonymous function, takes nested arrays.
[Answer]
## CJam, 17 bytes
```
{eeSf.*::+W%zSf-}
```
An unnamed block (function) which expects the matrix on the stack and replaces it with its antidiagonals.
[Test it here.](http://cjam.aditsu.net/#code=%5B%5B0%20%201%20%202%20%203%5D%0A%20%5B4%20%205%20%206%20%207%5D%0A%20%5B8%20%209%2010%2011%5D%5D%0A%0A%7BeeSf.*%3A%3A%2BW%25zSf-%7D%0A%0A~p)
This (found by Sp3000) works for the same byte count:
```
{_,,Sf*\.+W%zSf-}
```
### Explanation
This is best explained with an example. Consider the input:
```
[[0  1  2  3]
 [4  5  6  7]
 [8  9 10 11]]
ee    e# Enumerate matrix, turning each row [x ... z] into [i [x ... z]] where
      e# i is the vertical index from the top.
[[0 [0  1  2  3]]
 [1 [4  5  6  7]]
 [2 [8  9 10 11]]]
Sf.*  e# Replace each i with a string of i spaces.
[[""   [0  1  2  3]]
 [" "  [4  5  6  7]]
 ["  " [8  9 10 11]]]
::+   e# Prepend these strings to the rows.
[[0  1  2  3]
 ['  4  5  6  7]
 ['  '  8  9 10 11]]   e# Note that each '  corresponds to a space character.
W%    e# Reverse the rows.
[['  '  8  9 10 11]
 ['  4  5  6  7]
 [0  1  2  3]]
z     e# Zip/transpose.
[[ '  '  0]
 [ '  4  1]
 [ 8  5  2]
 [ 9  6  3]
 [10  7]
 [11]]
Sf-   e# Remove spaces from each row.
[[ 0]
 [ 4  1]
 [ 8  5  2]
 [ 9  6  3]
 [10  7]
 [11]]
```
[Answer]
## Python 2, ~~88~~ 87 bytes
```
lambda L:[filter(None,x)[::-1]for x in map(None,[],*[i*[0]+r for i,r in enumerate(L)])]
```
Prepend 0s, zip, then remove falsy elements. Returns a list of tuples. This uses `map(None,...)` to perform `zip_longest` (padding missing spots with `None`) and `filter(None,...)` to remove falsy elements.
Annoyingly, we need to add an extra `[]` row to the `map` to guarantee that a list of tuples is returned, since `map(None,*[[1]])` returns `[1]` rather than `[(1,)]` for a 1x1 matrix. The extra row gets stripped out by the `filter` though.
*(Thanks to @Dennis for -1 byte)*
[Answer]
# Ruby, ~~68~~ 66 bytes
Anonymous function.
```
->l{i=-1;k=[];l.map{|r|i-=j=-1;r.map{|e|k[i+j+=1]=[e,*k[i+j]]}};k}
```
* Because of how the splat operator works, I was able to save 2 bytes by forgoing the array addition.
[Answer]
# JavaScript (Firefox), ~~86~~ 75 bytes
```
a=>a.concat(a[0]).slice(1).map((_,i)=>[for(v of a)if(n=v[i--])n].reverse())
```
*Saved 11 bytes thanks to @Neil!*
Works in Firefox 30+. Takes an array of arrays.
[Answer]
# [Husk](https://github.com/barbuz/Husk/wiki/Commands), ~~3~~ 2 [bytes](https://github.com/barbuz/Husk/wiki/Codepage)
```
∂T
```
-1 byte thanks to *@mypronounismonicareinstate*.
[Try it online.](https://tio.run/##yygtzv7//1FHU8j///@jow11jHSMY3WiTXRMdcxiYwE)
**Explanation:**
```
 T  # Transpose the (implicit) matrix-argument; swapping rows/columns
∂   # Take the anti-diagonals of this transposed matrix
    # (after which the result is output implicitly)
```
[Answer]
## Mathematica, 60 bytes
```
#&@@@#&/@GatherBy[Join@@MapIndexed[List,#,{2}],Tr@*Last]&
```
where `` is a Unicode character which Mathematica reads as the postfix `\[Transpose]` operator.
This is a bit longer than the other Mathematica solution but I figured I'd post it because it doesn't use the `Diagonals` built-in and uses a completely different approach.
### Explanation
```
MapIndexed[List,#,{2}]
```
This first transposes the matrix (such that the antidiagonals appear in the correct order if the matrix was flattened). Then we map `List` over the cells of the matrix together with the index, which turns each matrix element `i` into `{i, {x, y}}` where `x` and `y` are the coordinates of the element in the matrix.
```
Join@@...
```
This flattens the outermost dimension, so that we now have a flat list of the matrix elements (with their coordinates) in column-major order.
```
GatherBy[..., Tr@*Last]
```
This groups those elements by the sum of their coordinates. Note that antidiagonals are lines of constant `x+y`, so this does exactly the grouping we want. The order within each group is preserved. Now we just need to get rid of the coordinates again. This is done via the rather cryptic:
```
#&@@@#&/@...
```
This maps the function `#&@@@#&` over each group, which itself *applies* `#&` to each element in the group, and `#` is simply the first argument, i.e. the original matrix element.
[Answer]
# Octave, 77 bytes
With a little abuse of the `accumarray` function:
```
@(M)char(accumarray(((1:size(M,1))+(0:size(M,2)-1)')(:),M(:),[],@(x){num2str(x')}))
```
This defines an anonymous function. To use it, assign to a varible or use `ans`.
Input is the matrix with `:` as row separator. Output is a cell array containing an array for each row (Octave's equivalent to jagged arrays). This is displayed by Octave showing the indices of the cell array and the contents of each cell. [Try it here](http://ideone.com/7a6Yie).
To display the result separated by spaces and newlines only: **83 bytes**
```
@(M)char(accumarray(((1:size(M,1))+(0:size(M,2)-1)')(:),M(:),[],@(x){num2str(x')}))
```
You can also [try it here](http://ideone.com/QbgMMd).
[Answer]
# Octave, ~~63~~ 62 bytes
Removed one byte thanks to ~~@DonMue...~~ @LuisMendo!
```
@(a)cellfun(@(x)x(x>0)',num2cell(spdiags(flipud(a)),1),'un',0)
```
I went the boring route and munged the antidiagonals.
Sample run on [ideone](http://ideone.com/iuAUhy).
[Answer]
# Haskell, ~~83~~ 82 bytes
```
r=zip[0..]
\o->fst$span(any(>0))[reverse[e|(x,t)<-r o,(v,e)<-r t,x+v==a]|a<-[0..]]
```
nimi saved a byte. Thanks!
[Answer]
# [C#], 100 bytes
```
for(r=0;r<l;r++)for(c=0;c<i[r].Length;c++)o[c+r]=o[c+r]?.Prepend(i[r][c]).ToArray()??new[]{i[r][c]};
```
[Try It online!](https://tio.run/##ZY9NS8QwEIbv/oqXnFKaLe3uKi7ZWsSbeBBW8BByWGJcAyWRaVFk6W@v6YdF8TQzzzzDzJhmZRrXfxwJDiW8/VQa5yUWhcBa4BKdWNhGYLcT2PxmW4FrgeKPV1zF2Shv1@jQyYthRx13uOzB@lP7NhPrB6ZyPWOki4EViskK021wvlVxQis9cYo8lxhSM6b9ayBOZS5pX0tK02SoTazN3in62SFN7ARlUtLlFKrskey79S980JTRSfYUbomOXzypqvGl89zpZH8XfBNqmz2Tay1nCixefWjJ@VN2H5znDAJMIGQHW1vT8gblDZj6p4koNUmkTLNkjIiJ7L8B)
Maybe there's a shorter way of inserting elements. Prepend and ToArray seems verbose, but that's the best I found.
[Answer]
# [Haskell](https://www.haskell.org/), 56 bytes
```
a!b=zipWith(++)([]:b)$a++repeat[]
foldr1(!).map(pure<$>)
```
[Try it online!](https://tio.run/##DcVLDoMgEADQvafAhAWEienYr03pNbogLMYIkRSVULrp5alv82b6vF2MtVI76l9Ir1BmoZQUxt5HyUmp7JKjYmzjtd/ilFG0slsoifTN7sGfsi4UVj1tDWMph7UwzjwzBqGHowVzgjNc9q9wg2EfD4AI2Ftb/w "Haskell – Try It Online")
[Answer]
# [Prolog (SWI)](http://www.swi-prolog.org), 111 bytes
```
A*B*C:-append(A,B,C).
s(A,B,C):-A*[B]*C.
N+B:-N=[A|X],X+R,Z*Q*R,maplist(s,[[]|Z],A,Y),Y*Q*B,!;maplist(=([]),B).
```
[Try it online!](https://tio.run/##NYu9DoIwFEZ33sINykcT/oxgGNo6k8gENB1INIYEpbEmLrx7LYrb/c45Vz/nab5F5j1aywgnoowGra@Pi8/AIQLqme0qI0YkV0RQrw55GdWVZEur0IYNenImDe6Dnkbz8g2kVEuvwNAF6Jzj2B3/tvKlCsADaq2UsVIhc3mMREGmyNzmv43UkQw59o6Jla0w/2ZFsdkD4pXEeyTuOXHliXreBw "Prolog (SWI) – Try It Online")
## Explanation
Let's first look a version of the code that not nearly so condensed.
```
snoc(Init,Last,List) :-
  append(Init,[Last],List).
diamondize([],Soln) :-
  maplist(=([]),Soln).
diamondize([FirstRow|Rest],Soln):-
  diamondize(Rest,RestSoln),
  append(BeginRestSoln,EndSoln,RestSoln),
  maplist(snoc,[[]|BeginRestSoln],FirstRow,BeginSoln),
  append(BeginSoln,EndSoln,Soln),
  !.
```
The `diamondize/2` predicate (`+/2` in the golfed version) is responsible for calculating what the diamond version of the input matrix is.
The predicate works recursively as follows: first it calculates the diamond version of the input matrix with its first row removed (`diamondize(Rest,RestSoln)`); then to calculate the diamond version of the entire input matrix it uses the fact that adding an initial row changes the diamond version by prepending a singleton list of the first element of the initial row and then pairing up each remaining element in the initial row with the first however many lists in the diamond and adding each initial row element to the end of its paired list, leaving the remaining lists in the diagonal unchanged. To do this in Prolog I use `append` to split `RestSoln` into a beginning, `BeginRestSoln`, and an end, `EndSoln`. Then I use the the builtin `maplist/4` to assert a relation between `BeginRestSoln`, the new initial row, `FirstRow`, and a new list `BeginSoln`. The `maplist/4` predicate asserts that all triples of elements of equal indices from the lists in its second, third, and fourth arguments will satisfy the predicate given as its first argument when it is called on them (note that this requires all the lists given as arguments to be of equal length). The predicate I use is `snoc/3` which asserts that when its second argument is added to the end of the list in its first argument, you get its third argument. Furthermore I add an empty list to the start of `BeginRestSoln` which means that when I `snoc` that with the first element of `FirstRow` the resulting first element of`BeginSoln` will be a singleton list of that aforementioned first element. The rest of `BeginSoln` will be the lists that began the diagonal version of the remainder of the matrix with the remaining elements of the first row added to the end, just as desired in the process described above. Finally to get the solution for the entire matrix we append `BeginSoln` with the unchanged `EndSoln`.
We have now covered the behavior of `diamondize/2` when the matrix is not empty, but the base case is the empty matrix. In that case the "solution" is considered to be a list of some undetermined length with `[]` for all its elements. This list is constructed using the `maplist/2` predicate which asserts that each element of the list given in its second argument satisfies the predicate given in its first argument. The predicate we use is `=([])/1` which is the partially applied `=/2` predicate which asserts that its two arguments unify, so our partially applied version asserts that its singular argument unifies with (ie is equal to) the empty list. However, since we do not specify a length, Prolog will attempt to satisfy the future goals with the shortest list containing only empty lists, backtracking and trying a longer such list if the future goals can't be satisfied. This behavior is very useful since in our first inductive case the predicates won't be satisfied unless the previous solution is at least one less than the length of the rows of the matrix, but we run into an issue in that longer lists of empty lists would also result in solutions that the program would consider valid, but would be invalid for this challenge. To avoid producing these solutions, we add a cut (`!`) to the end of the recursive case of `diamondize/2`, which will tell Prolog not to backtrack once we have a working solution.
Finally to golf the whole thing I used a number of tactics. First off, of course we can eliminate excess whitespace, and give variables and predicates shorter names. Then since `append/3` is being used a lot I can save a couple bytes by creating a copy of it with a shorter name, using an operator to name both it and what was the `diamondize/2` predicate (unfortunately since operator predicates technically can have at most two arguments, I cannot give `s/3` an operator name since I need to pass it to `maplist/4`). Finally I can consolidate the two cases of `+/2` into a single case with a disjunction.
[Answer]
# [BQN](https://mlochbaum.github.io/BQN/), 11 bytes
```
⌽¨+´¨∘↕∘≢⊸⊔
```
Anonymous tacit function. Takes a 2D array and returns a list of lists. [Try it at BQN online!](https://mlochbaum.github.io/BQN/try.html#code=RiDihpAg4oy9wqjiiqLiipTLnOKXi+KliivCtMKo4oiY4oaV4oiY4omiCgptIOKGkCBbWzExLDIsNV0sWzMsOTksM10sWzQsOCwxNV0sWzE2LDIzLDQyXV0KCkYgbQ==)
### Explanation
```
⌽¨+´¨∘↕∘≢⊸⊔
        ≢     Get the shape of the array (a list of two integers)
      ↕∘      Range (a 2D array of coordinate pairs)
  +´¨∘        Sum each of those pairs
              We now have an array in which the top left element is 0, the two elements
              in the next antidiagonal are 1, and so forth
         ⊸    With that as left argument and the original array as right argument,
          ⊔   Group the values of the right argument into buckets based on the
              corresponding number in the left argument
⌽¨            Reverse each antidiagonal
```
[Answer]
# [Pip](https://github.com/dloscutoff/pip), [19 bytes](https://chat.stackexchange.com/rooms/240/the-nineteenth-byte)
```
_RMxMZD:xRL_AL BMEa
```
[Try It Online!](https://dso.surge.sh/#@WyJwaXAiLCIiLCJfUk14TVpEOnhSTF9BTCBCTUVhIiwiIiwiIiwiW1sxOzI7M107WzQ7NTs2XTtbNzs4OzldXSAteHAiXQ==)
I'm a bit rusty. There might be a shorter way to do this with loops but oh well.
```
                ME  # Map [index item] for each item of...
                  a # Input
        --------ME  # Block
         RL         # Repeat...
        x           # The empty string
           _        # By the index
            AL      # Concatenate to...
               B    # The item
     ZD:            # Transpose, filling with ""
----M               # Map over each...
_RM                 # Remove
   x                # The empty string
```
[Answer]
# Python, 128 bytes (numpy)
```
(lambda A: (lambda A,S:[[A[U][I-U] for U in range(min(S[1]-1,I),max(I-S[0]+1,0)-1,-1)] for I in range(S[1]+S[0]-1)])(A,A.shape))
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), ~~41~~ 17 bytes
```
tm_<dx+dYk.T+LaYk
```
[Try it online!](http://pyth.herokuapp.com/?code=tm_%3Cdx%2BdYk.T%2BLaYk&input=%5B%5B1%2C2%2C3%5D%2C%5B4%2C5%2C6%5D%2C%5B7%2C8%2C9%5D%2C%5B10%2C11%2C12%5D%2C%5B13%2C14%2C15%5D%5D&debug=0)
Inspired by [@Doorknob's solution to another problem](https://codegolf.stackexchange.com/a/75591/48934).
How it works:
```
tm_<dx+dYk.T+LaYk
            +L      prepend to each subarray...
              aYk   (Y += ''). Y is initialized to [],
                    so this prepends [''] to the first
                    subarray, ['', ''] to the second, etc.
                    ['' 1  2  3
                     '' '' 4  5  6
                     '' '' '' 7  8  9
                     '' '' '' '' 10 11 12
                     '' '' '' '' '' 13 14 15]
          .T        transpose, giving us
                    ['' '' '' '' ''
                     1  '' '' '' ''
                     2  4  '' '' ''
                     3  5  7  '' ''
                     6  8  10 ''
                     9  11 13
                     12 14
                     15]
 m_<dx+dYk          removes all empty strings in the
                    subarrays while reversing each one
t                   remove the first subarray
```
---
Previous attempt:
```
JlQKlhQm_m@@Qk-dk}h.MZ,0-dtKh.mb,tJdUt+JK
```
[Try it online!](http://pyth.herokuapp.com/?code=JlQKlhQm_m%40%40Qk-dk%7Dh.MZ%2C0-dtKh.mb%2CtJdUt%2BJK&input=%5B%5B1%2C2%2C3%5D%2C%5B4%2C5%2C6%5D%2C%5B7%2C8%2C9%5D%2C%5B10%2C11%2C12%5D%2C%5B13%2C14%2C15%5D%5D&debug=0)
How it works:
```
JlQKlhQm_m@@Qk-dk}h.MZ,0-dtKh.mb,tJdUt+JK    input array stored as Q
JlQ                                          J = len(Q)
   KlhQ                                      K = len(Q[0])
       m                            Ut+JK    list for d from 0 to J+K-1:
        _m       }AAAAAAAAAABBBBBBBB             reversed list for k from A to B, where:
                  h.MZ,0-dtK                       A = max(0, d-(K-1))
                       0-dtK                               0  d-(K-1)
                            h.mb,tJd               B = min(J-1, d)
                                 tJd                       J-1  d
          @@Qk-dk                                    Q[k][d-k]
```
[Answer]
# Groovy, 77 73 75
```
{i->o=[].withDefault{[]};a=0;i.each{b=0;it.each{o[a+b++].add(0,it)};a++};o}
```
Takes array of arrays as input and returns array of arrays.
[Try it](http://groovyconsole.appspot.com/script/5084993378320384)
EDIT: I forgot to output the anwser, after adding it score goes up to 75.
[Answer]
# [05AB1E (legacy)](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~17~~ 16 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
εD0*«NFÁ]øí0δKʒOĀ
```
Unfortunately 05AB1E only has a builtin for the main (anti)diagonal, and not one for all (anti)diagonals, so we'll have to do things manually..
-1 byte by switching to the legacy version of 05AB1E, so the `0δK` can be `0K`.
[Try it online](https://tio.run/##MzBNTDJM/f//3FYXA61Dq/3cDjfGHt5xeK2B96lJ/kca/v@PjjbUMdIxjtWJNtEx1TED0uY6FjqWsbEA) or [verify all test cases](https://tio.run/##MzBNTDJM/V9Waa@k8KhtkoKSfeX/c1tdDLQOrfZzO9xYW3t4x@G1Bt6nJvkfafhfq/M/OjraUMdIxzhWJ9pEx1THDEib61joWMbG6igApaCUjhFQ3FjHBM5F0gARAomZghVZWkIlLXQMQSKGZjpGQK1GsbGxAA).
**Explanation:**
```
ε        # Map each row in the (implicit) input-matrix to:
 D       #  Duplicate the current row
  0*     #  Multiply each by 0, so we have a list of 0s the same length of the row
    «    #  Append the lists together
         #   i.e. [[1,2,3],[4,5,6],[7,8,9]] → [[1,2,3,0,0,0],[4,5,6,0,0,0],[7,8,9,0,0,0]]
     NF  #  Loop the (0-based) map-index amount of times:
       Á #   And rotate the row with appended 0s once towards the right each iteration
         #    → [[1,2,3,0,0,0],[0,4,5,6,0,0],[0,0,7,8,9,0]]
]ø       # After the map and inner loop: zip/transpose; swapping rows/columns
         #  → [[1,0,0],[2,4,0],[3,5,7],[0,6,8],[0,0,9],[0,0,0]]
  í      # And reverse each inner row
         #  → [[0,0,1],[0,4,2],[7,5,3],[8,6,0],[9,0,0],[0,0,0]]
0K       # Remove all 0s from each inner row
         #  → [[1],[4,2],[7,5,3],[8,6],[9],[]]
  ʒOĀ    # And filter out any empty rows
         #  → [[1],[4,2],[7,5,3],[8,6],[9]]
         # (after which the result is output implicitly)
```
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 78 bytes
```
{{⍵/⍨×≢¨⍵}{⍵/⍨×⍵}¨↓⍉(-⍳≢⍵)⌽⍵↑⍨1 2×≢⍵}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkG/6urH/Vu1X/Uu@Lw9Eediw6tAPJqkYSAPKBY2@RHvZ0auo96NwPVAMU0H/XsBVKP2iYCVRkqGIH1gtT@TwMa@qi371FX86PeNY96txxabwxS1Tc1OMgZSIZ4eAb/T1MwBkKgpKE20ERLrjQFEwVTON/IAAA "APL (Dyalog Unicode) – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 11 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Takes input as an array of space delimited strings, outputs a 2D array of integer strings.
```
ËiEç)¸ÃÕËÔf
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&header=bbg&code=y2lF5ym4w9XL1GY&input=W1sxIDIgM10gWzQgNSA2XSBbNyA4IDldXQotUQ) (header converts 2D arrays to the required input format) or [run all test cases](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&header=bbg&code=y2lF5ym4w9XL1GY&footer=Vq6uaVEgK1HDcSwgaSdbICsnXcNxLCBpJ1sgKydd&input=WwpbWzEgMiAzXSBbNCA1IDZdIFs3IDggOV1dCltbMV1dCltbMSwyXSxbMyw0XV0KW1sxLDIsM10sWzQsNSw2XV0KW1sxMSwyLDVdLFszLDk5LDNdLFs0LDgsMTVdLFsxNiwyMyw0Ml1dCl0KLW1S)
```
ËiEç)¸ÃÕËÔf     :Implicit input of array
Ë               :Map each element at 0-based index E
 i              :  Prepend
  Eç            :    E spaces
    )           :  End prepend
     ¸          :  Split on spaces
      Ã         :End map
       Õ        :Transpose
        Ë       :Map
         Ô      :  Reverse
          f     :  Filter
```
]