CoutLoot interview question

Flatten an array , can find on leetcode