code:
Testcase 2 and 3 not passing
@myself.yash.srivastav Just comment out line number 18 or the backtracking statement.Here you do not have to use backtracking…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.