Get Most Active Users Within Time Range

Asked at Microsoft · Coding Questions · Difficulty: Medium

Implement a function `GetMostActiveUsers` that takes a list of events and three integers `startTime`, `endTime`, `k`. Each event consists of a user ID, a timestamp, and a boolean `isOnline`. The events are unordered. Return the top `k` most active users between `startTime` and `endTime`, sorted by active time in descending order.

Loading the problem…