Same Solution getting different verdict

I was trying a problem in the DSA learning series, dynamic programming basic level,

can anyone say what is difference between these 2 codes:

I used same logic, in fact I viewed other person’s solution and i tried, only variable names are changed , then how come , i get partially correct and he get AC

i found my mistake

b = min(a,b)
this line has a special work to do , to minimise the time complexity
i missed it

Any ways no one has replied , i found it by myself thanks!


You have Contributed in “atamnirbhar bharat” :rofl: