You are given a string s consisting of words separated by spaces.
Your task is to reverse the order of the words in the string.
A word is defined as a sequence of non-space characters.
The words in s are separated by one or more spaces.
Return a new string containing the words in reverse order,
joined by a single space, with no leading or trailing spaces.
Input: s = " keep pushing forward "
Output: "forward pushing keep"
Input: s = "learn code every day"
Output: "day every code learn"
Input: s = "success requires consistency"
Output: "consistency requires success"
Accepted:
Submission: