Please tell the correct logic of this code

Hey @Bhavit_Singla
Take an unordered_set
Put all output strings in it rather than printing. It only contains one copy of each item. Then print the unordered_set

If your doubt is resolved please mark it as closed.

sir mein yahe pooch raha tha ki koi isa logic bana sakte hain ki jiss se sabhi permutation print ho sake ek he baari mein

@Bhavit_Singla
Agar aap saare strings ek unordered_set mein daal doge without printing them. End mein aapke paas ek set hoga jisme saare strings honge without duplicates. Ab aap unhe ek saath print kar skte ho.

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.