Untitled
unknown
plain_text
2 years ago
728 B
11
Indexable
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int arr[] = new int[n];
for(int i=0;i<n;i++){
arr[i]= sc.nextInt();
}
for (int i = 0; i <= arr.length; i++) {
for (int j = i+1; j<arr.length; j++) {
if (arr[i] == arr[j]) {
System.out.print(arr[j]+" ");
}
}
}
}
}
Editor is loading...