Length of the largest subarray with continuous elements
Given an array of distinct integers, find length of the longest subarray which contains numbers that can be arranged in a continuous sequence.
Examples:
Input: arr[] = {10, 12, 11};
Output: Length of the longest contiguous subarray is 3
Input: arr[] = {14, 12, 11, 20};
Output: Length of the longest contiguous subarray is 2
Input: arr[] = {1, 56, 58, 57, 90, 92, 94, 93, 91, 45};
Output: Length of the longest contiguous subarray is 5