Google Interview Question

2 leetcode like problems in 45 minutes