Meta interview question

Had two medium leetcode problems.