Store every element on the basis of sum of index ( i + j )
for ( let i = 0 ; i < nums [ 0 ] . length ; i ++ ) { for ( let j = 0 ; j < nums [ 0 ] . length ; j ++ ) { v [ i + j ] . push ( nums [ i ] [ j ] ) ; } }