Build a list from input values
Java
Easy
4 views
Problem Description
Task: create a List and add all given numbers in the same order.
Output Format
Return value
Constraints
Return empty list when no values.
Official Solution
static java.util.List<Integer> buildList(int... a){java.util.ArrayList<Integer> list=new java.util.ArrayList<>();for(int x:a) list.add(x);return list;}
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!