Recursion dictionary order smaller


what’s wrong sample output not matching

Jatin, I have edited your code, instead of character array, I have used a string, and now it is working perfectly fine, you can try to submit the code now,

1 Like

mam why did you commented out the 2nd swap ,why we don’t need to backtrack here?

ok thanks…I got it because string is not passed by reference. Am i right?

Yes, because if you pass by reference, then order would differ…

1 Like