@@ -0,0 +1,560 @@
+public class Solution %7B%0A    public String reverseWords(String s) %7B%0A        if(s.length() == 0 %7C%7C s.indexOf(%22 %22) == -1)%7B%0A            return s;%0A        %7D%0A        String%5B%5D words = s.split(%22 %22);%0A        StringBuilder result = new StringBuilder();%0A        for(int i = words.length - 1; i %3E= 0; i --)%7B%0A            if(words%5Bi%5D.length() != 0)%7B%0A                if(result.length() != 0)%7B%0A                    result = result.append(%22 %22);%0A                %7D%0A                result = result.append(words%5Bi%5D);%0A            %7D%0A        %7D%0A        return result.toString();%0A    %7D%0A%7D

Q151 Reverse Words in a String