time limit exceeded on two test cases ,why?
code-(“https://ide.codingblocks.com/s/97027”)
Why TLE on problem TRICKY PERMUTATIONS?
The execution of for loop, present inside the function, is causing TLE.
To avoid this,
Iterate the loop from i to n i.e.
for(j=i; j<n; j++) {}
Moreover, it makes sense as the main motive of recursive call is to repeat the same processing for each subsequent character of the string. Thus, iterating over the all possible permutations.
Hope, this would help.
If you still get the same error, let me know.