Get permutation

I cannot understand the two for loops used in the end,rrs.substring(0,i)+ch+rrs.substring…will make string of length when only c is passed as a string, how it will come bc,cb???

Try to dry run the code for few test cases. You’ll understand that.
Go through the video again and then try to code it yourself.