I think it's all correct but if anyone has suggestions please help!!!
package com.codegym.task.task07.task0717;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Duplicating words
*/
public class Solution {
public static void main(String[] args) throws Exception {
// Read strings from the console and declare an ArrayList here
ArrayList<String> list = new ArrayList<String>(10);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
for(int i=0;i<10;i++)
{
list.add(br.readLine());
}
ArrayList<String> result = doubleValues(list);
// 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<20;i+=2)
{
list.add(i,list.get(i));
}
return list;
}
}