Birdeye interview question

Flatten an arbitrarily nested array