General doubt in backtracking question

Question link : https://www.interviewbit.com/problems/combination-sum-ii/

Solution link : https://ide.codingblocks.com/s/479553

In the ‘find’ function, I am passing ‘t’ vector without reference to avoid any problem but is there any way so that i can pass it with reference as some time is being wasted in copying each time? Also the way should have the answer vectors in lexigraphical order. If possible then what changes should be made?

hello @deep4013

yes, u can pass by refernce. just afte line 28 , u need to pop back the last element from the vector.

first do inclusion case and then exclusion case to generate output in sortrd order

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.