Aggregate emoji reactions by name
Aggregate reactions by normalized emoji name, count unique users once, and retain deterministic first-seen group order.Description
Requirements
Export aggregateEmojiReactions from src/App.js.
Trim names and remove one surrounding colon pair before grouping.
Count each nonempty userId at most once within an emoji group.
Order groups by the first valid occurrence of each normalized name.
Return each group's unique userIds in ascending lexical order.
Return an observably equivalent result for equivalent inputs without reading time, randomness, network, storage, or DOM globals.
Do not mutate input objects, arrays, nested records, or values retained in the returned result.
Duplicate reaction
Ada reacts :shipit: twice
shipit count remains one for Ada
Trim names and remove one surrounding colon pair before grouping.
Mixed names
thumbsup then heart then :thumbsup:
Groups stay thumbsup, heart
Count each nonempty userId at most once within an emoji group.
Constraints
Implement a pure synchronous function with no external side effectsTreat every input collection and nested record as read-onlyReturn JSON-compatible data except where the declared TypeScript API explicitly uses bigint
Hints
Hint 1
Start with the normalizes-emoji-name behavior and make its observable result deterministic.
Hint 2
Model counts-unique-users independently before combining it with the remaining states.
Hint 3
Verify the boundary described by sorts-user-ids without changing caller-owned input.