“Write a program that takes an array of integers and finds the length of a longest subarray all of whose entries are equal.”
Are the subarrays contiguous?
“Write a program that takes an array of integers and finds the length of a longest subarray all of whose entries are equal.”
Are the subarrays contiguous?
Yes, the definition of subarray is contiguous. In general, the definition of array is a set of contiguous elements.
E.g., for A = [3,2,5,5,3,2,2,2,3,7,7,7,7,7,6,7,3,3,3,3] the longest subarray all of array entries are equal is A[9:13], i.e., the subarray of five 7s.