I have an array of arrays like this
[
[2, 0, 0, 2, 0],
[4, 0, 0, 0, 1],
[1, 1, 0, 0, 0],
[1, 0, 1, 0, 0]
]
And I am trying to create a new array by getting the first
value of each array so the output will be
[
[2, 4, 1, 1],
[0, 0, 1, 0],
[0, 0, 0, 1],
[2, 0, 0, 0],
[0, 1, 0, 0]
]
Is there any workarounds to achieve it? Thanks