#include #include int longestPlayground(const std::vector& arr) { if (arr.empty()) { return 0; } int maxLen = 1; int currentLen = 1; for (size_t i = 1; i < arr.size(); ++i) { if (arr[i] == arr[i - 1]) { currentLen++; } else { maxLen = std::max(maxLen, currentLen); currentLen = 1; } } maxLen = std::max(maxLen, currentLen); return maxLen; } int main() { std::vector arr = {1, 3, 3, 7, 9, 9, 9, 9, 11, 11, 12, 14}; int result = longestPlayground(arr); std::cout << result << std::endl; // Output: 4 return 0; }