@@ -0,0 +1,685 @@
+package leetcode;%0A%0A/**%0A * https://oj.leetcode.com/problems/reverse-words-in-a-string/%0A */%0Apublic class Problem151 %7B%0A    public String reverseWords(String s) %7B%0A        String%5B%5D strs = s.trim().split(%22%5C%5Cs+%22);%0A        StringBuilder sb = new StringBuilder();%0A        for (int i = strs.length-1; i %3E= 0; i--) %7B%0A            sb.append(strs%5Bi%5D);%0A            if (i %3E 0) %7B%0A                sb.append(' ');%0A            %7D%0A        %7D%0A        return sb.toString();%0A    %7D%0A    %0A    public static void main(String%5B%5D args) %7B%0A        Problem151 prob = new Problem151();%0A        System.out.println(prob.reverseWords(%22the sky is blue%22));%0A        System.out.println(prob.reverseWords(%22hello world%22));%0A    %7D%0A%7D%0A

Solve problem 151