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 think there is no overflow if you keep parameters type of the signature.
@g964 of course it is. Changing the parameters of my compare predicate to int16_t very much makes the tests fail due to overflow.
I didnt get overflow with the integer myself, I did it with C but im not a pro at this codewars thing obviously! :)
This kata is not concerned by overflow.
C++ thinks that (65536*65536 == 0), due to integer overflow. As a result, a test case of
will cause most solutions here in C++ and C (and probably many other languages) to be incorrect.
I guess I'm overly pedantic :-)
For Codewars, perhaps we're allowed to assume these kinds of issues don't exist. However, in the real world with real systems, it is important to be aware of this.
My only practical suggestion is that the Instructions should be updated to clarify that the numbers involved will not be so big and that "warriors" can assume overflow is not an issue