Subset sum dynamic array problem how it is storing

i dont understand that suppose you store the numbers in ans array like 6 5 3 and when I print the answer they are not their.The correct answer is printed somehow . i mean if its a dynamic answer array why would they vanish because once entered they should be their if we haven’t deleted them.

hi @abdevillers0111 in recursion if they get added while going deep they will get removed also when the stack space gets removed while coming down