Amazon Interview Question

one focused on greedy algorithms and the other on binary search