Problem Description

Given an array, find the first value that appears again when scanning from left to right. If no duplicate, print -1.

Input Format

One line: n then n integers.

Output Format

One integer (duplicate value) or -1.

Sample Test Case

Input:
7 4 3 2 1 3 2 5
Output:
3

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next