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.
OP solved it, closing...
Same here - I ran it in Visual Studio and got 5.
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.
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.
@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.Just checked the C++ version, it seems to be OK. You probably have some mistake in your solution.
First, get rid of those define clauses. Secondly, you wrote function signatures, but you didn't implement them. That's all that's missing.
Off-topic??? Use that kata's discourse section to post such questions.
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.