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.
I got the same issue. If i test it manually, everything is okay.
As you mentioned before, of cause there was an issue resetting the global var during recursion. In more detail the problewm was resetting the var if the input was a single digit after a sequence of inputs with multiple digit numbers.
Thank you for responsing. Have a nice day
It passes every test until the 0 test. I printed my output to see whats happening there and it seems that in this specific case my solution is not resetting.
It returns the last result again.
Of cause im using global var. Does it affect the test negativly?
I already know the initial value since logging n at the beginning of the funtion. But if i log the sum before returning too, it maybe helps..
Logging before returning the value seems to be a valid way to figure out why the test fails.
Thanks.
I will start some research soon
I just dont know whats going on. I appreciate all the other solutions of cause.
As I already said: System.out.println(n) = 0. With this Input my solution returns 0 too. I have no clue, sorry :)
If the EXPEXTED value is 0, the only way to achieve this is with input 0
Sorry? I just wrote my language and the input of the test too.
printed input: 0
output of my solution: 0
output of test: 9
language Java
Probably detected an issue here: Passed every test, but last one: expected 0 but was 9.
If I test input 0 in IDE it returns 0. What does it mean..
Language: Java