How do I get all columns as an array from a 2d array which is a rectangle
Q: What do I mean by saying rectangle? A: [[1,2,3],[1,2,3]] Inner arrays have more elements. Example: Input: [[1,2,3,4],[1,2,3,4],[1,2,3,4]] Desired Output: [[1,1,1],[2,2,2],[3,3,3],[4,4,4]] Output: [[1,1,1],[2,2,2],[3,3,3]] The reason of the problem: Main array has less elements, so, when I loop over it, as expected it will return an array with its own length. Shown in the example above.… Read More How do I get all columns as an array from a 2d array which is a rectangle