30 lines
722 B
Java
30 lines
722 B
Java
import java.io.*;
|
|
import java.util.*;
|
|
|
|
public class JavaList {
|
|
|
|
public static void main(String[] args) {
|
|
/*
|
|
* Enter your code here. Read input from STDIN. Print output to STDOUT. Your
|
|
* class should be named Solution.
|
|
*/
|
|
List<Integer> L = new ArrayList<>();
|
|
Scanner scan = new Scanner(System.in);
|
|
System.out.print("Enter the number of Queries: ");
|
|
int Q = scan.nextInt();
|
|
while (Q-- > 0) {
|
|
int N = scan.nextInt();
|
|
L.add(N);
|
|
}
|
|
int x = scan.nextInt();
|
|
int y = scan.nextInt();
|
|
L.add(x, y);
|
|
int xagain = scan.nextInt();
|
|
L.remove(xagain);
|
|
for (int i = 0; i < L.size(); i++) {
|
|
System.out.print(L.get(i) + " ");
|
|
}
|
|
scan.close();
|
|
}
|
|
}
|