Waymo interview question

leet code question: greedy algorithm