TuSimple interview question

a medium to hard coding challenge