Meta interview question

It was from Leetcode medium.