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>();
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
for(int i=0;i<10;i++){
String s = r.readLine();
list.add(s);
}
ArrayList<String> result = doubleValues(list);
// Display result
for(String s: doubleValues(list) ){
System.out.println(s);
}
}
public static ArrayList<String> doubleValues(ArrayList<String> list) {
//write your code here
ArrayList<String> list1 = new ArrayList<String>();
for(int i=0;i<list1.size();i++) {
for (int g = 0; g < 3; g++) {
list1.add( list.get(i));
}
}
return list1;
}
}
My code looks like above. what is wrong with the code
duplicates
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Guadalupe Gagnon
20 March, 16:09
What is the code supposed to do? We can't answer your question without knowing what the objectives are.
+1