Question d’entretien chez Apple

Given string, return it without whitespaces. Follow-up: Do it in-place.