Pergunta de entrevista da empresa Capgemini

Deep nested array , we have to flatten it without flat method in javascript.