Tricky permutation , it gave timelimit

what to do , other all test cases passed

Hi @vikashkmr519,
Your code takes too much time because there is a relative quicker implementation.
See follow this approach . Make a recursive function with two string parameters one for ans and one for query string just the way we should make in case of duplicates allowed permutations. But just to check for duplicacy add a flag and compare the current character to every character in the original query string . If the character exists that make the flag false and do not add this character recursively.if flag is true add it .

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.