Subset sum to target


What is wrong in this bottom up approach getting wrong answer test case 2

Hello @dsingh200021,

Problems:
The 2D array would not work for:

  1. n=5000
  2. sum>4999

Suggestions:
Read the constraints given in the question very carefully before writing the code.
(create a Boolean array as it requires less memory)

Modifications:

Hope, this would help.
Give a like if you are satisfied.

Its not working, 2 testcases still showing run error