What is your hint or solution suggestion?
The first line of code takes the transpose of the matrix, by inverting the row and column mappings. The second line of code sums each row of variables and integers together.
Solution 1
function loopSimult(A) {
var B = A[0].map((_, colIndex) => A.map(row => row[colIndex]));
var C = B.map(row => row.reduce((a, b)=> a + b, ''))
return C
}
Challenge: Loop over multiple arrays simultaneously
Link to the challenge: