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.
The author's solution as it exists does weird things on them, so for now, no.
Well all data types have a "Limit" to what they can hold or accomplish. there are workarounds for this. but I came back to do this kaya just becuse I though someones comment may be funny. they way they had it writ down I went to view the comment and it said I had not completed this kata so instead of forfeiting to view it I just did it, and now I cant find the comment :/ I think something happened on the server and it gave me someone elses comment and now I cant find it :/ Edit: to the limit thing. that part of the comment was that maybe it should have been left as is so people do some research into the data types and range limits but the isSafeInteger is a nice JS but all it does is check what I just said. I used it myself I use so many languages 99% of them are spoecified the same but others are a little off for whatever purpose
There should now be tests for these :)
Exactly, upper bound and upper bound + 1.
Currently, there only is a test for bound - 1.
Your right, I've changed the description and added a number of Random Tests.
I'm not 100% sure what edge cases I'd have to deal with this though, apart from testing the upper bounds of the maximum value for an Integer I'm not sure what else I should be testing :/
Tests could still do with improvements. Static tests for edge cases, and random tests.
Also,
less than
in the description should probably be changed toless than or equal to
, and while we're at it,size
tovalue
.Better!
Well spotted, Number.isSafeInteger() should now work for this.
Thanks for this! I've added another Test case for this.
Testing logic is wrong. See my solution. Using
Number.isSafeInteger()
therefore gives wrong results, which it clearly shouldn't.Please, set clearly what the max is. Improve testing to avoid cheating.
Should the plateaus be considered?
If so, test cases should be reviewed