Given a string s, reverse the order of words. A word is a sequence of non-space characters. Remove extra spaces.
Input: s = 'the sky is blue' Output: 'blue is sky the' Input: s = ' hello world ' Output: 'world hello'
Unlock hints progressively β start gentle, go deeper only if needed.
Level 1: Gentle Nudge
A subtle direction
Level 2: Approach
The algorithm to use
Level 3: Detailed
Step-by-step guidance
to save progress and use AI features