I’m solving the challenge 49 of codeabbey. After hours trying to solve the problem without using iterative structures a new issue arrise; we must avoid mutation.
Mutation is basically declaring a variable and overwrite it later.
I’m not an advanced programmer so the main purpose of this post is try to understand: How avoid mutation?
What do you understand or find about that problem
After fixing a simple mutation case in my code, I send the commit again, and this time, was found more mutation problems.
I think that in challenges where you must use recursion everywhere and track the result of a variable, would be almost impossible (at least for me) to avoid mutation, because you must update the variable and enter it again to the function (in the recursion ).
You make any workaround? What did you do?
At this point I don’t see any way to solve that issue, maybe with another 10h of searching, but I encourage the forum to help us with this kind of issues that probably will arise again to others parterns.
I need help with
Would be really helpfull understand how avoid mutations. And is not about just defining functions, because all that functions must be recursive, and when you are imbibing one function into another into another, into another … the logical starts to get really hard.