Given a string s of words separated by spaces, return a string of those words in reverse order , joined by a single space. Ignore leading and trailing spaces, and collapse any run of spaces between words to one. Input format Input is [s] , e.g. [ the sky is blue ] .