Caravans arrive at the cinnabar mines of Vermilion with crates of weights, and Chaplain the auditor must account for every last one. Task: Print the length of the longest run of consecutive integers present in the array (e.g. 4,5,6 counts as 3). Input format: First line: n. Second line: n integers. Output format: Print the longest consecutive run length. Constraints: 1 <= n <= 5154; -1000000 <= a[i],x <= 1000.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= n <= 5154; -1000000 <= a[i],x <= 1000.
