/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ class Ideone { { List<String> pairs = new ArrayList<>(); for (int i = 0; i < input.length(); ++i) { // Skip over non-alphabetic characters. // Look for the next alphabetic character: for (int j = i + 1; j < input.length(); ++j) { // Skip over non-alphabetic characters. // You've now found a pair. pairs.add("" + input.charAt(i) + input.charAt(j)); break; } } } }
Standard input is empty