Meta Interview Question

Flatten an array both in recursive way and non-recursive way.