events[i] = [user, minute] means that user user did something during minute minute. One user may perform several actions in the same minute, and different users may act at the same time.
A user's activity is the number of distinct minutes in which they did anything.
Return a list of length size where the element at index j (0-based) is the number of users whose activity is exactly j + 1 minutes.events=[[7, 10], [3, 10], [7, 12], [7, 10], [3, 15], [3, 16]], size=4 → [0, 1, 1, 0]
User 7 was active in minutes 10 and 12 (the second record at minute 10 does not count): 2 minutes. User 3 was active in minutes 10, 15 and 16: 3 minutes. The answer is [0, 1, 1, 0].
events=[[0, 5], [1, 5], [2, 5]], size=2 → [3, 0]
Three users with one active minute each: [3, 0].
size ≤ 10⁵events=[[7, 10], [3, 10], [7, 12], [7, 10], [3, 15], [3, 16]], size=4
[0, 1, 1, 0]
Run checks the first 3 tests in your browser. Submit checks all 110 tests on the server, hidden ones included.