lc151翻转字符串里的单词思路后序截取单词,顺序添加到结果字符串中代码 class Solution { public String reverseWords(String s) { s = s.trim(); int j = s.length()-1, i = j; StringBuilder res = new StringBuilder(); while (i >= 0){ while (i >= 0 && s.charAt(i) != ' '){ i--; } ...