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:

https://www.codechef.com/viewsolution/47014321
https://www.codechef.com/viewsolution/47342871

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!

2 Likes

You have Contributed in “atamnirbhar bharat” :rofl:

3 Likes