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
I am doing recursion, so declaring a new variable means the count won't work. Would declaring a new variable work with recursion?
You should declare a new variable inside your function on each call since otherwise the variable remains from previous calls.
I found the problem, but I do not know how to solve it. It is because I have a global variable for counting. The output the tests are getting is the addition of all the count.
Have a look at the documentation: https://docs.codewars.com/training/troubleshooting/
This comment is hidden because it contains spoiler information about the solution