public class Solution { public static void main(String[] args) throws Exception { // Read strings from the console and declare an ArrayList here ArrayList<String> strings = new ArrayList<String>(); BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); for (int i = 0; i < 20; i++) { strings.add(reader.readLine()); } ArrayList<String> result = doubleValues(strings); // Display result for (int i = 0; i < result.size(); i++) { System.out.println(result.get(i)); } } public static ArrayList<String> doubleValues(ArrayList<String> list) { //write your code here for (int i = 0; i < list.size(); i++) { list.add(i,list.get(i)); i++; } return list; } }