Google Interview Question

1. Array Problem 2. Tree Problem