Meta interview question

Leetcode Meta tagged with a twist