Largest Subarray With Contiguous Elements
easy
1. You are given an array(arr) of integers. Values may be duplicated. 2. You have to find the length of the largest subarray with contiguous elements. Note -> The contiguous elements can be in any order(not necessarily in increasing order).
Constraints
1 <= N <= 10^4 1 <= arr[i] <= 10^3
Format
Input
A number N arr1 arr2.. N numbers
Output
A number representing the length of the largest subarray with contiguous elements.
Example
Sample Input
3
10 12 11
Sample Output
3
Question Video