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.
Java Iterator
Java Iterator
Sort by
recency
|
218 Discussions
|
Please Login in order to post a comment
Those who thought (element instanceof Main); one minute of silence (R.I.P)....
import java.util.*; public class Main{
static Iterator func(ArrayList mylist){ Iterator it=mylist.iterator(); while(it.hasNext()){ Object element = it.next(); if(element instanceof String) if(element.equals("###"))
} @SuppressWarnings({ "unchecked" }) public static void main(String []args){ ArrayList mylist = new ArrayList(); Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); for(int i = 0;i
} }
if("###".equals(it.next())) break;
Here is Java Iterator solution - https://programmingoneonone.com/hackerrank-java-iterator-problem-solution.html