for(int i =0 ; i<rrs.length() ; i++) {
mr.add(rrs.substring(0, i) + cc + rrs.substring(i));
}
suppose “cc” here is ‘a’…and rrs for the time being is ‘bc’…now if rrs.length() is 2,this means the loop shall run for 2 times…but then how come the answer is coming out to be abc,bac,bca which is possible onlyif the loop runs for 3 times