flatten a multidimension array

Solutions on MaxInterview for flatten a multidimension array by the best coders in the world