Globant Interview Question

write custom logic to flatten an array