Question: What is output? public class WordScramble { public static void wordScramble ( String rem, String scr ) { if ( rem . isEmpty ( )

What is output?
public class WordScramble {
public static void wordScramble(String rem, String scr){
if (rem.isEmpty()){
System.out.println(scr + rem);
}
else {
for (int i =0; i < rem.length(); ++i){
wordScramble((rem.substring(0, i)+ rem.substring(i +1, rem.length())),(scr + rem.charAt(i)));
}
}
}
public static void main(String args[]){
wordScramble("123","");
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!