Mam/Sir can you tell me how many times does this for loop excecute for all the path
from 1 to 10:
import java.util.*;
class getboardpath {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(getboardpath(1,10));
}
public static ArrayList getboardpath(int curr,int end){
if(curr==end) {
ArrayList pos=new ArrayList();
pos.add(" ");
return pos;
}
if(curr>end) {
ArrayList<String> pos=new ArrayList<String>();
//negative.add();/ /return null
return pos;
}
ArrayList<String> mr=new ArrayList<>();
for(int dice=1;dice<=6;dice++) {
ArrayList<String> rr=getboardpath(curr+dice, end);
for(String a:rr) {
mr.add(a+dice);
}
}
return mr;
}
}