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.
JavaScript sample tests do not import chai.
JavaScript should be updated to Node 18 and use chai.
Updated in this fork
Not a bug. Since this Kata is still using Node v8, the sort is not stable, as this was not required at the time.
Since ECMAScript version 10 (ES2019), the specification dictates that Array.prototype.sort must be stable (preserve order). This was introduced to Node with version 12.
Modern browsers usually adhere to the newest specification, but it's good to keep in mind that programming only for the newest specification might break stuff for older browsers/systems.
JavaScript fork (author gone)
O(1) formulas are only approximations for this problem. I don't see why solutions with an inaccuracy as high as
0.01
should be allowed.added
approved
Seems like a floating-point error. The tests should probably be changed to allow for precision errors (e.g. using
assert.approximately
instead ofassert.strictEqual
).Yeah, I was unsure about that. Adding it would invalidate basically every solution, as the tests did not work before.
I could add negative tests that expect
undefined
or an error, which would allow for those solution to stay up.Fixed
JavaScript fork (author inactive)
Your random tests don't generate negative numbers.
The Go translation is incorrect. It's mentioned in this open issue, but nobody has fixed it yet.
approved
Resolved with this update
Loading more items...