https://codeforces.com/contest/1097/problem/B
Sir I am not getting anything how to do this question please can you me the approach for this.
https://codeforces.com/contest/1097/problem/B
Sir I am not getting anything how to do this question please can you me the approach for this.
this should be ur recurrence relation->
solve(sum,i) = solve(sum+a[i],i+1) || solve(sum-a[i],i+1);
base case : if i==n return sum==0;
No sir I am not familiar with dp
ok , then do it brute force using recursion or bitmask.
recursive approach->
Sir is it OK to learn dp after bitmasking?
learn and practice recursion before dp
Ok sir thanks for guiding
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.