Hello, I am working on a recursion exercise. Sample output below. I have to find the cheapest path from bottom left to top right of a 2D grid. I can only traverse up and right (north and east).
However, my program is printing out ALL the possible routes, and NOT the cheapest. (There are more paths but it wouldn't fit the screenshot. It also doesn't recursively call itself forever.)
Does anyone have any insight? Attached below in the link is my recursive method. I am thinking something is wrong with the if statement inside my base case but I don't know what... why is it doing this, and how do I go about fixing it?