Meta Interview Question

signed nda but similar to leetcode