Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
0 is the initial value of a.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce
It seems you messed up the sample tests, backup your code, click Reset, paste it and try again, they should look like this:
you are not required to (and should not) mutate the input matrix; your algo is wrong. try your function with e.g.
[[1, 2], [3, 4]]
, it returns[ [ 1, 3, 1, 3 ], [ 2, 4, 2, 4 ] ]
, which is not the transpose of[[1, 2], [3, 4]]
What language?
This comment is hidden because it contains spoiler information about the solution
Read this: https://docs.codewars.com/training/troubleshooting/#works-but-no
Don't use global vars, they keep their values between tests. If you call your function several times in a row in your IDE it'll fail there too.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Because of the array zero based indexing.