Can you tell me why there is TLE in all cases except one

only one test case is passing.Why?

u need to use Dynamic Programming since the constraints are large

I used dynamic programming but still the code is not working

i see a recursive code in ur submission
send code in cb ide

this is the link:https://ide.codingblocks.com/s/265461

image
memset can assign -1 , 0 , 1 only

syntax is wrong
memset( dyn , valueTObe asgined , sizeof(dyn))

but still its not passing the test cases

added comments

thanku so much,the code passed all the test cases

1 Like