We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Scanner sc = new Scanner(System.in);
int p = sc.nextInt();
List> lisOfLis = new ArrayList<>();
for(int i=0;i list1 = new ArrayList<>();
for(int j=0;j= 0 && x < p && y >= 0 && y < lisOfLis.get(x).size()){
List newlist = lisOfLis.get(x);
System.out.println(newlist.get(y));
}else{
System.out.println("ERROR!");
}
}
sc.close();
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Arraylist
You are viewing a single comment's thread. Return to all comments →
Scanner sc = new Scanner(System.in); int p = sc.nextInt(); List> lisOfLis = new ArrayList<>(); for(int i=0;i list1 = new ArrayList<>();
for(int j=0;j= 0 && x < p && y >= 0 && y < lisOfLis.get(x).size()){ List newlist = lisOfLis.get(x); System.out.println(newlist.get(y)); }else{ System.out.println("ERROR!"); }
}
sc.close();