Doubt in gold grid problem

in this sir make a dp array.
dp[x,y]=dp[x-1,y]+dp[x,y-1]-dp[x-1,y-1]
my doubt is that what is thelogic behind “DP[X-1,Y-1]”.

@Royal_Yashasvi hey ,dp[i][j] wha tak ke rectangle ka ans deta hai jha tk i,j,so dp i j depend on previous results of rectangles to i,j-1 ek represent krega and i-1,j ek krega ab hme dono me se common htana hai ,common jo hai i-1,j-1 represent krega islie use minus kia taki required ans ajaye.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.