CoutLoot Interview Question

Flatten an array , can find on leetcode