Doubt in a question

I am solving this dp question from leetcode…
221. Maximal Square
I have come up with this recursive solution till now, but this recursive solution is also showing the wrong output.
Could you help me please to find the bug.
This is my code…


Thanks

This is updated code… But showing wrong answer https://ide.codingblocks.com/s/346124

Hello @ashishnnnnn , You have pretty much Understood what the problem is about but while using the top-down approach you are returning the maximal square that can be made by considering right bottom element.
But the problem states that the maximal square can be anywhere. Take an int in the function call which will store the maximum of all the return calls in the top-down approach.
You will be able to solve this problem. Happy learning !! If your doubts get resolved please mark this doubt as resolved . Thankyou