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.
Then make sure the value is valid before calling the method.
For this kata, calling
count
is very expensive and unnecessary. You should avoid it and either call it only as many times as required, or (even better) do not use it at all (it's not needed here).You need to take the advantage of the fact that except the one unique number, all other numbers are equal. Using this fact, you can avoid counting them every time.
This comment is hidden because it contains spoiler information about the solution
return an integer ->
int(...)
Different data type.
This comment is hidden because it contains spoiler information about the solution
me too :(
Thank you Hobovsky!
This comment is hidden because it contains spoiler information about the solution
Please read the last bullet point in this paragraph of FAQ: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution#when-i-print-my-answer-it-looks-exactly-the-same-as-the-expected-output-yet-tests-fail
This comment is hidden because it contains spoiler information about the solution