2 test cases pass and 2 gives tle
hello @rohitkandpal683
instead of using two set,
first generate all permuations and store it in vector.
then sort the vector ,and then print only those strings from vector which satisfy the required condition.
it is allowed,
before calling the function store in string in some other variable because after function call in will change
https://ide.codingblocks.com/s/243356 it gives 2 tle and 2 wrong answers and here i store IN in string d
make this change in ur code
![]()
thanks for help now code works