Volkswagen Group interview question

Flat the array without using any inbuilt functions