Brillio interview question

1 simple DSA question was asked to flat a nested array without using flat function.