#C11634. Longest Unique Skills Subarray

    ID: 40972 Type: Default 1000ms 256MiB

Longest Unique Skills Subarray

Longest Unique Skills Subarray

You are given a list of skills, each represented as an integer. Your task is to find the length of the longest contiguous subarray in which all the skills are unique. In other words, for any subarray (A[i\ldots j]), if each skill within the subarray is distinct, then its length is (j-i+1).

Input will consist of an integer (N) (the number of skills) followed by (N) integers. Your program should output the maximum length of any contiguous subarray that contains no duplicate values.

inputFormat

The first line of input contains an integer (N), the number of skills. The second line contains (N) space-separated integers representing the skills.

outputFormat

Output a single integer denoting the length of the longest contiguous subarray which contains only unique skills.## sample

7
1 2 3 1 4 2 3
4

</p>