Longest subarray with all elements same
Given an array arr[] of size N, the task is to find the largest subarray which consists of all equal elements.Examples: Input: arr[] = {1, 1, 2, 2, 2, 3, 3}; Output: 3 Explanation: Longest subarray with equal elements is {2, 2, 2}Input: arr[] = {1, 1, 2, 2, 2, 3, 3, 3, 3}; Output: 4 Explanation: Lon