Tricky permutations

getting wrong answer in testcase 1 and 2. Please tell where i am lacking.

There can be more than 2 occurrences of a permutation. Its best to use set when needed to keep distinct values.

Thanks for help able to solve the question.

1 Like