Merge pull request #1634 from Allen9012/master
更新 字符串板块 实现strstr 这道题的题目链接
This commit is contained in:
commit
2cfe222983
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
# 28. 实现 strStr()
|
# 28. 实现 strStr()
|
||||||
|
|
||||||
[力扣题目链接](https://leetcode.cn/problems/implement-strstr/)
|
[力扣题目链接](https://leetcode.cn/problems/find-the-index-of-the-first-occurrence-in-a-string/)
|
||||||
|
|
||||||
实现 strStr() 函数。
|
实现 strStr() 函数。
|
||||||
|
|
||||||
|
|
@ -699,7 +699,7 @@ class Solution(object):
|
||||||
if haystack[i:i+n]==needle:
|
if haystack[i:i+n]==needle:
|
||||||
return i
|
return i
|
||||||
return -1
|
return -1
|
||||||
```
|
```
|
||||||
```python
|
```python
|
||||||
// 方法一
|
// 方法一
|
||||||
class Solution:
|
class Solution:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue