Subset sum to target

gettin run time error on one of the test cases

in the case when you write dp[i-1][j-a[i]] it should be dp[i-1][j-a[i-1]]

still getting run time error

It is because u are starting loop from zero and a[0-1]=a[-1] which is wrong.

@Ankit003 I’m still getting run time error.
my code link: https://ide.codingblocks.com/s/241575