TuSimple interview question

dynamic programming and searching problem