Skip to content

Commit 236b85a

Browse files
committed
auto commit
1 parent fe29962 commit 236b85a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

notes/58.1 翻转单词顺序列.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Output:
1616

1717
## 解题思路
1818

19-
先旋转每个单词,再旋转整个字符串
19+
先翻转每个单词,再翻转整个字符串
2020

2121
题目应该有一个隐含条件,就是不能用额外的空间。虽然 Java 的题目输入参数为 String 类型,需要先创建一个字符数组使得空间复杂度为 O(N),但是正确的参数类型应该和原书一样,为字符数组,并且只能使用该字符数组的空间。任何使用了额外空间的解法在面试时都会大打折扣,包括递归解法。
2222

notes/58.2 左旋转字符串.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
## 题目描述
88

9+
将字符串 S 从第 K 位置分隔成两个子字符串,并交换这两个子字符串的位置。
10+
911
```html
1012
Input:
1113
S="abcXYZdef"

0 commit comments

Comments
 (0)