beginner
Trim and Clean Spaces
Remove leading, trailing, and duplicate spaces between words.
📝 提示内容
Write a function named cleanSpaces that takes a messy string. It should remove all leading and trailing whitespace, and ensure there is only one space between each word in the output.