Skip to content

Commit 651e031

Browse files
committed
feat: update solution to lc problem: No.1451
1 parent caa9ede commit 651e031

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

solution/1400-1499/1451.Rearrange Words in a Sentence/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ class Solution {
166166

167167
```ts
168168
function arrangeWords(text: string): string {
169-
let words: string[] = text.split(" ");
170-
words[0] = words[0].toLowerCase();
171-
words.sort((a, b) => a.length - b.length);
172-
words[0] = words[0].charAt(0).toUpperCase() + words[0].slice(1);
173-
return words.join(" ");
169+
let words: string[] = text.split(' ');
170+
words[0] = words[0].toLowerCase();
171+
words.sort((a, b) => a.length - b.length);
172+
words[0] = words[0].charAt(0).toUpperCase() + words[0].slice(1);
173+
return words.join(' ');
174174
}
175175
```
176176

solution/1400-1499/1451.Rearrange Words in a Sentence/README_EN.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ class Solution {
151151

152152
```ts
153153
function arrangeWords(text: string): string {
154-
let words: string[] = text.split(" ");
155-
words[0] = words[0].toLowerCase();
156-
words.sort((a, b) => a.length - b.length);
157-
words[0] = words[0].charAt(0).toUpperCase() + words[0].slice(1);
158-
return words.join(" ");
154+
let words: string[] = text.split(' ');
155+
words[0] = words[0].toLowerCase();
156+
words.sort((a, b) => a.length - b.length);
157+
words[0] = words[0].charAt(0).toUpperCase() + words[0].slice(1);
158+
return words.join(' ');
159159
}
160160
```
161161

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function arrangeWords(text: string): string {
2-
let words: string[] = text.split(" ");
3-
words[0] = words[0].toLowerCase();
4-
words.sort((a, b) => a.length - b.length);
5-
words[0] = words[0].charAt(0).toUpperCase() + words[0].slice(1);
6-
return words.join(" ");
7-
}
2+
let words: string[] = text.split(' ');
3+
words[0] = words[0].toLowerCase();
4+
words.sort((a, b) => a.length - b.length);
5+
words[0] = words[0].charAt(0).toUpperCase() + words[0].slice(1);
6+
return words.join(' ');
7+
}

0 commit comments

Comments
 (0)