Wrong answer for 2nd test case of subsey sum to target problem

I have used a 2d Dp array of (n+1)*(sum+1)
Here is my code