TuSimple interview question

Sorting, BFS