SUBSET SUM EASY Recursion

[
@Prateek-Narang-10209 @deepakaggarwal . Sir test cases are not passing. Please help.
code link: https://ide.codingblocks.com/#/s/13388
question link : https://hack.codingblocks.com/contests/c/452/136

Hey akshay ! there are many errors in your code . You have taken an array β€œarr” inside a recursive call and saving a value in it and calling next recursive call but this time you are again creating a new array which is different from the previous array and does not contains the previous saved values. And one more thing , your code will not print anything if value of akki becomes -1 for multiple test cases .
So, you should fix these first.

Now my code works fine for t(no. of test cases)=1(using exit) but not for other values of t.
How to break out of recursive calls @Prateek-Narang-10209 @deepakaggarwal.
new code : https://ide.geeksforgeeks.org/GriPuLzt4J

I have made changes as you suggested @O17LPOLC0033. Thanks.
Now my code works fine for t(no. of test cases)=1(using exit) but not for other values of t.
How to break out of recursive calls
new code : https://ide.geeksforgeeks.org/GriPuLzt4J

Okay Akshay try this code , i modified ur code here -->> https://ide.codingblocks.com/#/s/13503

1 Like