Meta interview question

Leetcode medium question, look them up!