TuSimple interview question

Some question using priority queue, not difficult