sir my code is not giving any ouput in this question of sum it up using backtracking. can you please help?? code link:https://ide.codingblocks.com/s/191099
Sum it up backtracking - Not giving output
hi there were few minor error
for the case where u are not including the present digit u got to update the sum as sum-=a[i]
I have updated the code:
but here u`ll get a WA since all the combinations are not unique there are duplicate combinations that are being printed, try to remove this by inserting if condition.
In case u are not able to figure out, fell free to ask
maam unable to figure out why for some it is giving duplicate elements and for rest not
those elements that occur more than one in the i/p array give u a duplicate combination
try to do a check on this condition when a[i] == a[i+1] and i > 0 u do not include that combination
ma’am still unable to understand
Mam Please Reply!!!..
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.