Ad
  • Custom User Avatar

    OP solved it, closing...

  • Default User Avatar

    Same here - I ran it in Visual Studio and got 5.

  • Custom User Avatar

    It's difficult to tell why your code is wrong without seeing it. My crystal ball got broken, sorry. Nonetheless, your code would pass the tests if it were correct, and if it does not pass, it menas it's not correct. The fact that it works for you locally is a good sign, but still not enough.

  • Custom User Avatar

    Well, I'm not gonna give you the solution... I told you where to look at (spoiler: I fixed it and solved it with your code). There are random tests with random arrays so it's likely that you're not using the same inputs.

    And by the way, there is a thread open already, so you should reply to it, not spam the whole thread with more posts. But if you're just gonna keep downvoting people trying to help you, well... good luck on your own.

  • Custom User Avatar

    @TheCoder99: Are you actually trolling? You keep posting questions and issues, which I answered and you just keep posting new ones without looking at the replies.

  • Custom User Avatar

    Just checked the C++ version, it seems to be OK. You probably have some mistake in your solution.

  • Custom User Avatar

    First, get rid of those define clauses. Secondly, you wrote function signatures, but you didn't implement them. That's all that's missing.

  • Custom User Avatar

    Off-topic??? Use that kata's discourse section to post such questions.

  • Custom User Avatar

    Please use code formatting as shown here https://github.com/Codewars/codewars.com/wiki/Markdown-Formatting#block-code-formatting when posting code, otherwise it's difficult to read.

    Your loops are both set up incorrectly and are checking either too much or too little.