PayPal interview question

Flatten an array (recursive and iterative)