Uber Interview Question

2 easy/medium coding questions on leetcode