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.
I suggest to put in the instructions that the tests are performed against perfect float point number equality or else I would implement a fixed error tolerance (
myVar.toFixed(margin)
).Indeed it wasn't too hard to solve the kata, I had to learn a lot about regex though.
The difficult part was dealing with having to go through strings such as
0.6666666e+10
, which I couldn't figure out why were giving me errors, until I realized I had to parse these strings and return an exact number in order to pass the test (by exact number I don't just mean a number, I mean the number expected by the test case with zero error tolerance).If the purpose of this is to add difficulty to the problem then I would state in the instructions that long floating numbers might appear (i.e.
1.232323232e+n
) and the test cases have a zero error tolerance, otherwise I think it's a nice kataThis comment is hidden because it contains spoiler information about the solution