// Online C++ compiler to run C++ program online #include using namespace std; int main() { int arr[12] = {1, 3,3 ,7, 9,9,9,9,11,11,12,14}; for(int i = 0; i< 12; i++) { cout << arr[i] << " "; } int maxLen = 1, currLen = 1,num = arr[0]; for(int i = 0; i < 12; i++){ if(arr[i] == arr[i - 1]){ currLen++; if(currLen > maxLen){ maxLen = currLen; num = arr[i]; } }else { currLen = 1; } } cout << "\n" << maxLen; return 0; }