Fashion Elements 2
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
An array of integers is given. Print only those elements that are repeated several times. That is, the numbers that occur once are not displayed at all, and from several identical elements in the array, select the one with the highest index. If such elements do not exist, print NO.
Input
First line contains number n. Next line contains n integers. All numbers do not exceed 100 by absolute value.
Output
Print in one line the repeated elements in array.
Examples
Input #1
Answer #1
Input #5
Answer #5
Input #7
Answer #7
Submissions 3K
Acceptance rate 34%