give input string s reverse order wordsA word define sequence nonspace character the word s separate spacereturn string word reverse order concatenate single spaceNote s contain lead trail space multiple space word the return string single space separate word do include extra space Example 1input s sky blueoutput blue sky theExample 2Input s hello world output world helloexplanation your reversed string contain lead trail spacesexample 3input s good exampleoutput example good aExplanation you need reduce multiple space word single space reverse string Constraints1 slength 104s contain english letter uppercase lowercase digits space there word s Followup if stre datum type mutable language solve inplace O1 extra space