For this question , for each test case I am getting 1 duplicate answer . However i am unable to understand why I am gettin the duplicate , rest all the test cases are passing . Please help me debug my code .
Link to the code
For this question , for each test case I am getting 1 duplicate answer . However i am unable to understand why I am gettin the duplicate , rest all the test cases are passing . Please help me debug my code .
Link to the code
@imsharan0105 your code is correct :
just use set to insert strings which will remove the duplicacy and then push the string in set into vector: https://ide.codingblocks.com/s/426860
Thank you but there was 1 repeating test case . we solved that problem by using set i get it but why was it coming . was there some condition that i was missing?
@imsharan0105 actually your code is completely different so yes this is because of the logic and the recursion calls it must be leading you to the duplicacy.
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.