@ChiragJindal7
The major problem with your code is that you are using a common global vector to store your results and cleaning it afterwards. Using global variables/objects across recursion is complicated and not at all adviced. You have used it and that is where your mistake lies. After you reach a valid configuration , you clear the vector making all other configurations using the same partial vector invalid.
Instead , pass this vector as an argument in your recursion function. That will sort your code out to a great extent. Also , the if condition where you check arr[si] <= t is not a problem… The problem is the else part. There should not be a else clause. The recursive call that you have made in else part should be made always , whatever the condition.
Also , the condition where you check t==0 should be the base case instead of second.
Make these changes and try again .