Find Consistent Logs

Problem Overview

  • Find the maximum-length subarray where the most frequent player in the subarray appears as many times as the least frequent player in the entire array.
  • Input: arr of n playerIds (1 ≤ n ≤ 10^4); Output: an integer for the longest consistent logs length.
  • Context: analyze gaming tournament event logs to understand player participation.
  • This is a Google interviews coding interview problem and a common interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: