NeetCode #28LC-186MediumArrays & HashingNC Algo100
← Back to All Problems

#28 · #186 · Reverse Words in a String II(翻转字符串里的单词 II)

📌 Problem Statement & Constraints

Given a character array s containing a sequence of words separated by single spaces, reverse the order of the words in place. A word is a maximal run of non-space characters, and there are no leading or trailing spaces. Constraints: 1 <= s.length <= 10^5.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!