You are viewing a single comment's thread. Return to all comments →
Has anyone faced the problem that code does not print to stdout even though it does in local machine? here is my code
try (Scanner aScanner = new Scanner(System.in)){ int num = aScanner.nextInt(); List<String> linesAfterDeduplication = new LinkedList<>(); for (int i = 0; i <= num; i++) { String line = aScanner.nextLine().trim(); Matcher matcher = pattern.matcher(line); while (matcher.find()) { line = line.replace(matcher.group(0), matcher.group(1)); } linesAfterDeduplication.add(line); } for (String line : linesAfterDeduplication) { System.out.println(line); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Regex 2 - Duplicate Words
You are viewing a single comment's thread. Return to all comments →
Has anyone faced the problem that code does not print to stdout even though it does in local machine? here is my code