I have an array within an array, for example:
[
[0, 20, 5],
[5, 0, 15],
[5, 10, 0]
]
I need to get the max number in each column.
- The max of
[0 , 5 , 5]
is5
, so that goes into the result array. - The max of
[20, 0, 10]
is20
, so that goes into the result array. - The max of
[5, 15, 0]
is15
, so that goes into the result array.
The final result array must contain [5, 20, 15]
.