You are viewing a single comment's thread. Return to all comments →
public class Solution { @SuppressWarnings({ "unchecked", "rawtypes" }) public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int numLenght = scanner.nextInt(); int strLenght = scanner.nextInt(); ArrayList list = new ArrayList(); for (int i = 0; i < numLenght; i++) { list.add(scanner.nextInt()); } list.add("###"); for (int i = 0; i < strLenght; i++) { list.add(scanner.next()); } list.stream().filter(s -> s instanceof String && ((String) s).matches("[a-zA-Z]+")).forEach(System.out::println); scanner.close(); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Iterator
You are viewing a single comment's thread. Return to all comments →