According to the editorial of this question, if I pass “ABA” as input, won’t I get AAB AAB ABA ABA as the output ?
Tricky permutation
No, the question asks you to print the non-repeating permutations. That is , for this example. AAB, ABA, BAA
According to the editorial of this question, if I pass “ABA” as input, won’t I get AAB AAB ABA ABA as the output ?
No, the question asks you to print the non-repeating permutations. That is , for this example. AAB, ABA, BAA