While solving dp ,i think we have all solved the problem subset sum==target ,its pretty basic ,now what if there were q queries for different target sums,obviously the brute force wud be to reconfigure the dp array before each query ,but the whole process would then take O(N*Q*T) time ,which has a high chance of giving TLE, can you guys suggest ways to initialize the dp array only once ,and keep it constant across all queries ?








store the values of target left instead of sum we made.
why is that so
It's a standard problem I think
use bitset :)
can you provide example
umm refer bitset tutorial , how it works