Domanda di colloquio di Apple

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