Https://ide.codingblocks.com/s/257217

2 test cases are showing wrong answer :frowning:

@Muskan-Gupta-598128740703036 hey ,let me check your code.

@Muskan-Gupta-598128740703036 hey,dp array ko INT_MIN se initialise kro ,also next loop k+2 se start hoga ,please check this pseudo code and dry run it you will get it:
ex

sir , Int min se initialise krne ki zaroorat hi nhi hai

and k+2 se kyu ?? hint video mei bhi same hi kiya hai ki , k +1 se N tak forward dp and 1 to N tak backward dp

@Muskan-Gupta-598128740703036 hey mein apko code change krke deta hoon submit krke ,wait.

@Muskan-Gupta-598128740703036 hey I have changed your code slightly,mene dpf[k] klo initialise kia hai also dpf[k+1] ko initialise kia hai tabhi mein k+2 se start kene ko keh rha tha loop ,also ye islie kia hai taki age k+2 se further in dono ki help se fill ho ,pehle woh grabage se fill horhe the:


Hope you get it ,feel free to ask any doubt :slight_smile:

oh !! sorry , done finally… but int_min toh aapne abhi bhi nhi kiya :stuck_out_tongue:

uski zaroorat nhi thi , i was confused that why it’s necessary :\

@Muskan-Gupta-598128740703036 glad you got it,hn uski jaroorat nhi thi.

cool sir , Thanks ! :slight_smile: