Meta Interview Question

Leetcode style question, nothing tricky