public String reverseWords(String s) {
        if (s == null)
            return null;
        String[] arr = s.trim().split("\\s+");
        if (arr.length == 0)
            return "";
        String res = "";
        for (int i = arr.length - 1; i > 0; --i)
            res += arr[i] + " ";
        res += arr[0];
        return res;
    }