Meta Interview Question

Two leetcode questions. One easy, one hard