By adding another variable to calculate return ans the code will work, but I don’t understand the need for it.
this is my code:
Like this is my recursive code for wines problem , in this if I rather initialising ans I return k the code works. So can you please explain when to initialise another variable and when don’t.