class Solution {
public String reverseWords(String s) {
if(s==null || s.length()<=1) return s;
String[] sarr=s.split(" ");
int len=sarr.length;
StringBuilder sb=new StringBuilder(sarr[len-1]);
for(int i=len-2;i>=0;i--){
String temp=sarr[i];
sb.append(" ").append(temp);
}
return sb.toString();
}
}