week16
151 - 翻转字符串里的单词
class Solution {
public:
string reverseWords(string s) {
reverse(s.begin(), s.end());
stringstream ss(s), res;
string word;
while(ss >> word)
{
reverse(word.begin(), word.end());
res << word << ' ';
}
string ans = res.str();
ans.pop_back();
return ans;
}
};152 - 乘积最大子数组
153 - 寻找旋转排序数组中的最小值
154 - 寻找旋转排序数组中的最小值II
155 - 最小栈
160 - 相交链表

Last updated