Test case is not passing

Sir/Ma’am

I am not able to pass any of the test cases but my approach seems ok. Can you please help me out

here is the link to my code : https://ide.codingblocks.com/s/287867

I am not able to solve MLE error.

@sinhadivyam19 MLE because n se 1e9 dp array cant store that much use map instead
also some other errors corrected code


dont forget to hit like and mark resolved if cleared :smiley: