Implement `collapseSpaces(s)` that replaces any run of whitespace with a single space and trims the ends.
+ 1 hidden test run on Submit.
Replacing /\s+/g with a single space and trimming normalizes irregular whitespace.
Run your code to see results.