Meta Interview Question

two leetcode style algorithm questions