Subset sum target problem

getting TLE in one test case

Instead of returning a boolean value, return an integer because the type of your dp array is int.
Here is your corrected code. Please check it.

Now its giving TLE in two test cases

It gave correct answer for me

Surprisingly, its giving TLE when I’m solving it from the course section. Whe I solved it on hackerblocks, all test cases passed… probably some issue with the system.

Oh Okay. I will get this issue checked. Meanwhile, you can mark your doubt as resolved now.