Most Popular Video Creator
You are given two string arrays creators and ids, and an integer array views, all of length n. The i^th video on a platform was created by creators[i], has an id of ids[i], and has views[i] views.
The popularity of a creator is the sum of the number of views on all of the creator's videos. Find the creator with the highest popularity and the id of their most viewed video.
- If multiple creators have the highest popularity, find all of them.
- If multiple videos have the highest view count for a creator, find the lexicographically smallest id.
Note: It is possible for different videos to have the same id, meaning that ids do not uniquely identify a video. For example, two videos with the same ID are considered as distinct videos with their own viewcount.
Return a 2D array of strings answer where answer[i] = [creatorsi, idi] means that creatorsi has the highest popularity and idi is the id of their most popular video. The answer can be returned in any order.
creators = ["alice","bob","alice","chris"], ids = ["one","two","three","four"], views = [5,10,5,4][["alice","one"],["bob","two"]]creators = ["alice","alice","alice"], ids = ["a","b","c"], views = [1,2,2][["alice","b"]]Constraints
- n == creators.length == ids.length == views.length
- 1 <= n <= 10^5
- 1 <= creators[i].length, ids[i].length <= 5
- creators[i] and ids[i] consist only of lowercase English letters.
- 0 <= views[i] <= 10^5