Circular merge Help needed

Been stuck on this for a long time. Can’t figure out whats wrong:

My approach:
(By bhagirathi08)

1 Like

This is how I solved the problem.
I solved this 2-months ago while practicing dp:-

Now, using its concepts CIMERGE can be solved. :slight_smile:


Thanks! I’ll try this…
But I really suck at dp, always end up looking at the editorial… any tips? How do you approach dp?

1 Like

You just have to change INT_MAX to some large value. INT_MAX has value of 2147483647 but the larger testcases may exceed this.

1 Like

Tried it:
Still WA.

There is another INT_MAX inside the f function.

1 Like

THANKS!!! It Worked! :raised_hands::raised_hands::raised_hands: