Theo the chronicler watches over the spice bazaar of Saffronia's stores of weights. A careful computation stands between order and chaos. 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 <= 7222; -1000000 <= a[i],x <= 1000000.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= n <= 7222; -1000000 <= a[i],x <= 1000000.
