Amazon Interview Question

Divide and conquer algorithms, start with simple solution then optimize