Meta Interview Question

the same as on Leetcode