@@ -0,0 +1,673 @@
+package problems;%0A%0Apublic class ReverseWords %7B%0A    public String reverseWords(String s) %7B%0A        String st = s.trim();%0A        if (st.length() == 0)%0A            return %22%22;%0A        %0A        String%5B%5D a = st.split(%22 %22);%0A        StringBuilder sb = new StringBuilder();%0A        %0A        for (int i = a.length - 1; i %3E= 0; i--) %7B%0A            if (!a%5Bi%5D.equals(%22%22))%0A                sb.append(a%5Bi%5D).append(%22 %22);%0A        %7D%0A        sb.deleteCharAt(sb.length() - 1);%0A        return sb.toString();%0A    %7D%0A    %0A    public static void main(String%5B%5D args) %7B%0A        ReverseWords rw = new ReverseWords();%0A        String s = rw.reverseWords(%22   a  %22);%0A        System.out.println(s);%0A    %7D%0A%7D%0A

Add ReverseWords