Recursion-Dictionary Order(Larger)

please check the code. 3 testcases failed aut of 4.

your output is correct but noi in the same order as in testcase.try
for (int i = 0; i < str.length(); i++) {
char cc = str.charAt(i);
printPermutations(ros, str.substring(0, i) + str.substring(i + 1)+ cc);
}