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.
Resolved in above fork
Resolved
This is a good Kata! Maybe I'm just stupid, but it took me forever to notice that the 'Window' of the submarine was an 'O' and not a '0'. My RegExp suffers.
I have removed the reference solution from the fixed tests.
I would be ok with switching the input to be a heteregeneous array, but I would like recommendations on how to improve the description's lack of clarity.
"Most solvers don't even use arguments, but a rest parameter, thus defeating your purpose"
That is correct, but either way requires a use of lesser known features of js as opposed to iterating over a given array parameter.
map(x=>x ? x : 0) as been applied to both operands of the test case to prevent floating point issues.
I'm not incredibly familiar with floating point 'Errors'
Do you think applying a round to any dividing functions passed in as an argument would fix the test failing?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Corrected
I came from a background of C# development so I am used to typeof producing a type which would then need string "casting", and I am still learning lots about JS and TS.
That being said, good catch and thanks for the help!
Very readable!
This would not work for a number with a decimal count greater than 20, but works as a quick and dirty solution for all test cases in the Kata.
the largest annoyance with this kata was the input of both a string and a number array. the spread operator was quite a clever solution to solve that caveat.