Meta interview question

Leetcode style question, nothing tricky