Out of memory error in susbset sum to target . [dp]

error occurs for second test case:

Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
at Main.main(Main.java:15)

Hey @dhruv.160410116084
Your code is perfect
Issue is due to Java memory constraints
Maybe the program couldn’t assign enough memory for the array


You can submit this code and get 100
Your code is perfect

this code gives wrong ans

@dhruv.160410116084
I submitted it right now and got AC
You might have forgotten to change language to C++ before submitting
So look into it

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.