Pergunta de entrevista da empresa Samsara

A problem solving question that had a sorting aspect I could not figure out.