C# One liner solution, 132ms


  • 0
    O
    public string ReverseWords(string s) 
    {
       return string.Join(" ", new Stack<string>(s.Split(new char[]{' '}, StringSplitOptions.RemoveEmptyEntries)).ToArray());
        }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.