No same permutation problem


My code not working. I am not able to find the mistake. May I know my mistake

@nayakashutosh99
Consider this tescase
1
1 10 10
your code is printing
1 10 10
10 1 10
10 1 10
10 10 1
10 10 1
which consists duplicate permutations.

Ahhh okay. Thank you got accepted.

But how to do it without using set and map?

You can compare adjacent string in your final result vector. If they are same print just once.
Thankyou

yeah this will work but I thought there would be some other way. Thank you!

1 Like