2 test cases are showing wrong answer
Https://ide.codingblocks.com/s/257217
@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:
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 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
oh !! sorry , done finally… but int_min toh aapne abhi bhi nhi kiya
uski zaroorat nhi thi , i was confused that why it’s necessary :\
cool sir , Thanks !