Waymo Interview Question

leet code question: greedy algorithm