Ad
  • Custom User Avatar

    very fun kata! :)

  • Custom User Avatar

    For C, if n is a + b and both a and b are non-negative, then why does the function pass in a signed value (and why is it "const")? That needless complictes this clever problem.

  • Default User Avatar

    You are probably solving on 64-bit Windows where long is 32-bit. Codewars runs on 64-bit Linux where long is 64-bit. As a quickfix, you can use long long in your solution. But I agree, this is an issue, C/C++ code on Codewars should never use long as it makes the user experience worse for Windows users.

  • Default User Avatar

    finally solved...cant believe it! after expeding some time a day trying to optimice. Learnt a lot :3