Pergunta de entrevista da empresa Skydio

How to solve a function that modifies data in place.