Pergunta de entrevista da empresa Trane

Given an array that could contain more arrays, write a recursive function to flatten the array.