You need to return the recursive call to your function. Your code works for 15, but it doesn't when you have to use recursion. In the error message "15 should equal 6", it doesn't mean the input value was 15, it means your function returned 15 instead of 6.
You need to return the recursive call to your function. Your code works for 15, but it doesn't when you have to use recursion. In the error message "15 should equal 6", it doesn't mean the input value was 15, it means your function returned 15 instead of 6.
That's a problem with your code, not a kata issue:
You're doing recursion wrong.