Problems
Radio 106 FM
Radio 106 FM
You are given a list of songs that have been played on 106 FM so far. There are n songs in total in the list. Find the length of the longest fragment of songs that consists of non-repeating songs.
Input
The first line contains the number of songs n (1 ≤ n ≤ 105
). The second line contains n numbers k1
, k2
, ..., kn
(1 ≤ ki
≤ 109
) - identification numbers of the songs.
Output
Print the length of the longest non-repeating fragment of the song.
Input example #1
8 1 2 1 3 2 7 4 2
Output example #1
5
Input example #2
4 1 1 2 1
Output example #2
2