Meta Interview Question

2 leetcode questions. 1 easy and 1 hard