the code i had written is all correct but still it didn’t passes the testcases correctly… please help me in correcting out…
Subset recursion
The output should be printed as follows :
- Sets with least no of elements should be printed first.
- For equal length, elements that appear later in the original set, should be printed first.
so to match 2nd condition first you have to flip the order of recursion call
first not select current element and then in next call select current element
to match 1st condition you have to store all answers in an vector and then sort the vector with compare function
check the modified Code below
Modified Code
i hope this help you
feel free to ask if you have any doubt
okay sir, understood the concept. Thank you!
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.