Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 396 Bytes

README.md

File metadata and controls

18 lines (14 loc) · 396 Bytes

Length of largest contiguous array

Given an array of distinct integers, can you find length of the longest subarray which contains numbers that can be arranged in a continuous sequence.

For example:

Input:  arr[] = {10, 12, 11};
Output: 3
     
```bash
Input:  arr[] = {14, 12, 11, 20};
Output: 2
Input:  arr[] = {1, 10, 23, 11, 13, 14, 15, 12, 98}
Output: 5