Pergunta de entrevista da empresa Mobile Programming

Coding question to flatten array.