Sum It Up - Backtracking - Test case not passing

Two of the test cases are not passing . Please go through my code . Thank you in advance.

Hi Ayush,
extreme apology for late reply.
Your code is not printing the output in desired order.
For e.g.Consider test case
15
78 7 62 28 73 68 94 88 65 61 59 21 92 4 97
90
Expected Output:
4 21 65
7 21 62
28 62
Your Output:
28 62
4 21 65
7 21 62
Please try to modify your code and revert back here with the updated code.
If you aren’t able to make correct changes,we are here to help you.

It is solved now, just sorted the string answer correctly. Thanks🙂