1817. Finding the Users Active Minutes

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1817

class Solution:
    def findingUsersActiveMinutes(self, logs: List[List[int]], k: int) -> List[int]:
        d = defaultdict(set)
        for i, t in logs:
            d[i].add(t)
        res = [0] * k
        for ts in d.values():
            res[len(ts) - 1] += 1
        return res