Practice Interview Questions
| Question | Status |
|---|---|
Given a string of words, write a function to reverse the words in the string. The function should also remove any leading or trailing whitespace and reduce multiple spaces between words to a single space.
Example:
Input: "This is the best"
Output: "best the is This"
Input: " space here"
Output: "here space"
Constraints: