Amazon Interview Question

Two Sum and tree search.