#2456

Most Popular Video Creator

expert · 1000 · lc medium +32 · 45.2% accepted · 308 likes · top 28%

Description

You are given two string arrays creators and ids and an integer array views, all of length n. The ith video was created by creators[i], has ID ids[i], and has views[i] views.

A creator's total viewership is the sum of views across all their videos. Find the creator(s) with the highest total viewership; among their videos, identify the one with the most views (breaking ties by lexicographically smallest ID).

Return a 2D string array where each entry is [creator_name, video_id] for each top creator. The order of entries does not matter.

Code

1
2
3