mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-10 12:15:58 +08:00
Merge pull request #2257 from hbm666/br
update 剑指Offer58-II.左旋转字符串 - Java错误注释修改
This commit is contained in:
@ -120,7 +120,8 @@ class Solution {
|
|||||||
```
|
```
|
||||||
|
|
||||||
```java
|
```java
|
||||||
//解法二:空间复杂度:O(1)。用原始数组来进行反转操作
|
// 解法二
|
||||||
|
// 空间复杂度:O(n)。String 的 toCharArray() 方法底层会 new 一个和原字符串相同大小的 char 数组
|
||||||
// 思路为:先整个字符串反转,再反转前面的,最后反转后面 n 个
|
// 思路为:先整个字符串反转,再反转前面的,最后反转后面 n 个
|
||||||
class Solution {
|
class Solution {
|
||||||
public String reverseLeftWords(String s, int n) {
|
public String reverseLeftWords(String s, int n) {
|
||||||
|
Reference in New Issue
Block a user