#include #include using namespace std; int longestPlayground(const vector& arr) { int maxCount = 1, currentCount = 1; for (size_t i = 1; i < arr.size(); i++) { if (arr[i] == arr[i - 1]) { currentCount++; maxCount = max(maxCount, currentCount); } else { currentCount = 1; // Reset count for new number } } return maxCount; } int main() { vector arr = {1, 3, 3, 7, 9, 9, 9, 9, 11, 11, 12, 14}; cout << longestPlayground(arr) << endl; // Output: 4 return 0; }