Google Interview Question

2 LeetCode hard level questions and 1 hour to solve.