
题目
Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
解答
1 |
public class { |
注解
暴力匹配,没啥好说的,时间复杂度为 O(n*n)。

Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
1 |
public class { |
暴力匹配,没啥好说的,时间复杂度为 O(n*n)。
近期评论