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.
If you ain't using 3 loops, you ain't trying!
This comment is hidden because it contains spoiler information about the solution
like and share your views
It could, but it won't throw an error, JavaScript doesn't care.
x/0 = Infinity
and0/0 = NaN
.I've committed another solution where I make use of "Pair":
https://www.codewars.com/kata/reviews/61541e19b41962000146c253/groups/6154def037cc2d0001cc5dbc
Personally I like this solution more, but I understand the aspect of not beeing as performant as it could be ;-)
Thanks, I added some more test cases. Does that work for you?