Reverse Words In A String
Difficulty: Easy
Acceptance: %
Points: 20.00
Given a string s, reverse the order of the words in the string while keeping the individual words unchanged. Words are separated by spaces.
Note: The output string should have words separated by a single space, with no extra spaces at the beginning or end.
Expected Time Complexity: O(n)
Expected Space Complexity: O(n)
Constraints: - 1 <= s.size() <= 10^6
- String s contains only lowercase English alphabets and spaces.
Companies: Amazon Microsoft Adobe Goldman Sachs Cisco + 1 more
Please log in to access the Submissions tab, where you can review your progress and explore code submissions from other participants.
Please log in to access the Solution tab and view detailed answers and explanations.
Please log in to access the Discussion tab and join conversations with other participants.