Meta interview question

the same as on Leetcode