Pergunta de entrevista da empresa Aurora Innovation

How would you solve the following data organization problem using the fewest lines of code. Any drawbacks to this approach?