users
) to map each username to a list of websites they visited, sorted by timestamp.username
, timestamp
, and website
arrays to populate the users
dictionary.patterns
counter to keep track of the number of users that visited each pattern.patterns
counter with these combinations, ensuring each combination is counted only once per user by converting to a set.patterns
counter. If there is a tie, return the lexicographically smallest pattern.