We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4d09ed commit 180760eCopy full SHA for 180760e
2018.12.2-leetcode557/Avalon.md
@@ -0,0 +1,17 @@
1
+class Solution {
2
+ public String reverseWords(String s) {
3
+ String[] sArr = s.split(" ");
4
+ StringBuilder sb = new StringBuilder();
5
+ int len = sArr.length;
6
+ for (int i=0;i<len;i++){
7
+ char[] temp = sArr[i].toCharArray();
8
+ int tlen = temp.length;
9
+ for (int j=0;j<tlen;j++){
10
+ sb.append(temp[tlen-1-j]);
11
+ }
12
+ if (i!=len-1)
13
+ sb.append(" ");
14
15
+ return sb.toString();
16
17
+}
0 commit comments