Ad
  • Custom User Avatar

    I think there is no overflow if you keep parameters type of the signature.

  • Custom User Avatar

    @g964 of course it is. Changing the parameters of my compare predicate to int16_t very much makes the tests fail due to overflow.

  • Custom User Avatar

    I didnt get overflow with the integer myself, I did it with C but im not a pro at this codewars thing obviously! :)

  • Custom User Avatar

    This kata is not concerned by overflow.

  • Custom User Avatar

    C++ thinks that (65536*65536 == 0), due to integer overflow. As a result, a test case of

    a = [65536]
    b = [0]
    

    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