I have first sorted the input array. And then generated all combinations through inclusion exclusion. In base case i check if sum is equal to given sum. If it is then i create a string ans put it in a set so that i only get unique solutions.
Test cases not passing in Sum it Up
I think u sent a different code.
Sorry about that. Here is the link to my code -
Consider the testcase:
15
78 7 62 28 73 68 94 88 65 61 59 21 92 4 97
90
in this, ur code do not give the answer in lexiographical order