Javascript – How to sort 2D array from horizontal (left-to-right) to vertical (top-to-bottom)
I want to convert the 2d array which is missing some values and has been sorted from left to right to a new array which is sorted from top to bottom like below examples. Cols and rows and the number…