Capgemini Interview Question

remove multiple space between the words in an array and their should be only one space between the words