Pergunta de entrevista da empresa TuSimple

One medium to hard level coding problem