Tricky permutation code review

codelink: https://pastebin.com/czHvKdKv
here is my code I don’t understand what’s wrong in it and why not it is giving ouput

Hey @Divya_321,

I have corrected your code:


Refer to the comments for better understanding.

It has been specified in the question:
NOTE: DO NOT USE MAP OR SET.
So, please think of an approach that do not uses set or map.

Hope, this would help.
Give a like if you are satisfied.