Factorialize Challenge Possible Bug

I’m doing the Factorialize Challenge and my code returns the factorial but the computer doesn’t seem to be recognizing it. I was wondering if this is a bug or if I’m doing something wrong.

Nevermind. The global array variable was causing the problem. I just needed to move it into the function.

That global variable arr is the culprit. Each FCC test will have access to any global variables you use in your code. What this means to your solution, is that each test that executes will start with arr having the value it had at the end of the previous FCC test. You need to figure out another approach that does not require a global array to work if you plan to use a recursive solution to solve this challenge.

Thanks for the reply. I wasn’t sure why that was causing the problem and your explanation helped. :smile: