public class Solution { public String ReverseSentence(String str) { String[] s = str.split(" "); String s1 = ""; int len = s.length; for(int i = len - 1;i >=0;i--){ if(i != 0){ s1 += s[i] +" "; }
else{
s1 += s[i];
}
}
return s1;
}
}