1 cout dp problem

my code


getting wa in one test case.used the two pointer approach