Merge pull request #1893 from Logenleedev/my-contribution

minor modification 去除多余代码
This commit is contained in:
程序员Carl
2023-02-15 16:16:05 +08:00
committed by GitHub
2 changed files with 12 additions and 3 deletions

View File

@ -219,9 +219,6 @@ class Solution:
def fib(self, n: int) -> int:
# 排除 Corner Case
if n == 1:
return 1
if n == 0:
return 0

View File

@ -194,6 +194,18 @@ class Solution:
```
```python 3
# 方法五:另类的切片方法
class Solution:
def reverseLeftWords(self, s: str, n: int) -> str:
n = len(s)
s = s + s
return s[k : n+k]
# 时间复杂度O(n)
# 空间复杂度O(n)
```
Go
```go