Remove duplicates from a list of integers
EasyProblem Statement
Remove duplicates from a list of integers
Sample Input
[1, 2, 2, 3, 3, 3, 4]
Sample Output
[1, 2, 3, 4]
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
import java.util.*;
public class Main {
public static List<Integer> removeDuplicates() {
List<Integer> lst = Arrays.asList(1, 2, 2, 3, 3, 3, 4);
// Your code here
return lst;
}
}
Input
[1, 2, 2, 3, 3, 3, 4]
Expected Output
[1, 2, 3, 4]