[leetcode]Implement strStr() @ Python - 南郭子綦 - 博客园: " if len(haystack) < len(needle): return None
i = 0
while i < len(haystack)-len(needle)+1:
j = 0; k = i
while j < len(needle):
if haystack[k] == needle[j]:
j+=1; k+=1
else:
break
if j == len(needle):
break
else:
i+=1
if i == len(haystack)-len(needle)+1:
return None
else:
return haystack[i:]"
'via Blog this'
Blog Archive
-
▼
2014
(190)
-
▼
September
(29)
- [Leetcode] Longest Valid Parentheses @Python - Sum...
- 霸气侧漏的在读博士
- Programming Interview Questions
- temp
- InstallingANewHardDrive - Community Help Wiki
- Clustering With K-Means in Python | The Data Scien...
- LeetCode题解整理版(二) | Coding 4 Fun
- [leetcode]Simplify Path @ Python - 南郭子綦 - 博客园
- [leetcode]Implement strStr() @ Python - 南郭子綦 - 博客园
- [leetcode]Valid Palindrome @ Python - 南郭子綦 - 博客园
- [leetcode]Copy List with Random Pointer @ Python -...
- [leetcode]Swap Nodes in Pairs @ Python - 南郭子綦 - 博客园
- [leetcode]Remove Nth Node From End of List @ Pytho...
- [leetcode]Add Two Numbers @ Python - 南郭子綦 - 博客园
- [leetcode]Rotate List @ Python - 南郭子綦 - 博客园
- [leetcode]Plus One @ Python - 南郭子綦 - 博客园
- [leetcode]Valid Sudoku @ Python - 南郭子綦 - 博客园
- How to Read Linux Top Command Output and Uses - Te...
- [leetcode]Valid Sudoku @ Python - 南郭子綦 - 博客园
- Dropped iphone 5 in water. Help? | Apple Support C...
- [leetcode]Permutation Sequence @ Python - 南郭子綦 - 博客园
- C++11 improvements over C++03
- K-means算法及k-means++、SVD的优化 - 推酷
- Programming Interview Questions
- 统计学习笔记(2)——感知机模型 - Liam Q的专栏 - 博客频道 - CSDN.NET
- 科学网—[转载]常见面试之机器学习算法思想简单梳理 - 李建扣的博文
- soulmachine/machine-learning-cheat-sheet
- 美国一类优先移民EB1A
- c++ - Compiling C++11 with g++
-
▼
September
(29)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment