Recursion- dictionary order

getting wrong answer for testcases 2 and 3

@Faizan-Ali-1395131367301898 Consider the input:
Input: abc
Expected Output:
acb
bac
bca
cab
cba
Your code’s output:
acb
bac
bca
cba
cab

Your code is finding out the correct permutations but printing in a different order.

still showing one test case wrong

@Faizan-Ali-1395131367301898 https://ide.codingblocks.com/s/158289
Try to submit it now and check.
here you do not have to use backtracking as i have said…you just have to go with simple recursion.
Backtracking will give wrong output(actually the correct permutations but in the order which is not required in this problem) in this case as the test cases are set according to the simple recursive way.

Hope this helps :slightly_smiling_face:

still get testcase-1 as wrong answer

It is passing all the test cases in my side. I suppose the question is same as this https://hack.codingblocks.com/app/contests/718/p/361

yeah same question …can u send me the code which u r running

thanks can u please explain optimal game strategy problem

I think there is already a video on it in the Dynamic Programming section of your course where the recursive approach is also explained… You can refer that.