Meta interview question

Leetcode 347. Leetcode 486 Ad aggregators