Volkswagen Group Interview Question

Flat the array without using any inbuilt functions