Pregunta de entrevista de Bright Data

It was a LeetCode-style task about array transformation