dp solution will works if array has only positive elements . but if array has negative numbers . and if we get the total sum is negative then in dp vector creation problem will occur because of this negative total sum and compailer will shows heap-buffer-overflow
Bhaiya I knew that binary search have to be used but ...to form the equation and utilize it to find the remaining elements .....how to build intuition for such problems ?
how dp will work partition arrays must always of size n, but we are saying can we generate a given target from subsequence but that may or may not be size n
I think this dp solution will only work if array has all positive or all negative values , and also in this question there is a constaint that we can choose only N/2 elements, which also not fulfilled in the dp solution.
I don't actually comment on videos but after seeing your explanation, I had to!! Amazing explanation bhaiya, your channel deserves more subs and more views!! I really hope you will rock in the future.
Hats off to your Efforts but Very Worst Explanation... Ek hi cheez jo striver ne explain nhi ki usme hi problem ho rahi hai.. Whole dsa on youtube is worst ever except striver.