Tap here to switch tabs
Problem
Submissions

Problem: Most Popular Video Creator

Try to solve the Most Popular Video Creator problem.

Statement

You are given two string arrays creators and ids, along with an integer array views, all of length nn. The iextthi^{ ext{th}} video was created by creators[i], has an identifier ids[i], and has received views[i] views.

The popularity score of a creator is defined as the sum of views across all videos they have produced.

Find the creator with the maximum popularity score. If multiple creators share the highest popularity score, select all of them.

For each of the most popular creators, determine their most viewed video identifier:

  • If a creator has multiple videos tied for the highest view count, choose the video whose identifier is lexicographically smallest.

Return a list of pairs [creator, id] representing each top creator and the identifier of their most viewed video. The answer may be returned in any order.

Constraints:

  • n=n = creators.length == ids.length == views.length

  • 1≤n≤1051 \leq n \leq 10^5

  • 1≤1 \leq creators[i].length, ids[i].length ≤5\leq 5

  • creators[i] and ids[i] consist only of lowercase English letters.

  • 0≤0 \leq views[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Most Popular Video Creator

Try to solve the Most Popular Video Creator problem.

Statement

You are given two string arrays creators and ids, along with an integer array views, all of length nn. The iextthi^{ ext{th}} video was created by creators[i], has an identifier ids[i], and has received views[i] views.

The popularity score of a creator is defined as the sum of views across all videos they have produced.

Find the creator with the maximum popularity score. If multiple creators share the highest popularity score, select all of them.

For each of the most popular creators, determine their most viewed video identifier:

  • If a creator has multiple videos tied for the highest view count, choose the video whose identifier is lexicographically smallest.

Return a list of pairs [creator, id] representing each top creator and the identifier of their most viewed video. The answer may be returned in any order.

Constraints:

  • n=n = creators.length == ids.length == views.length

  • 1≤n≤1051 \leq n \leq 10^5

  • 1≤1 \leq creators[i].length, ids[i].length ≤5\leq 5

  • creators[i] and ids[i] consist only of lowercase English letters.

  • 0≤0 \leq views[i] ≤105\leq 10^5