Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
728 B
4
Indexable
Never
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]+" ");
                    
                }
            }

            
        }
    }
}