Ive written a code which will end up some desired outcome but there is a very high probability for the code to face "stack overflow error".
Is there anyway