leetcode oj 28 字符串匹配 kmp 下标从0开始 kuangbin模板

28. Implement strStr()

  • Total Accepted: 146121
  • Total Submissions: 546205
  • Difficulty: Easy
  • Contributors: Admin

Implement strStr().

Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.

Subscribe to see which companies asked this question



代码:

class Solution {
public: int f[ 150000];

void getfill(string t)
{
  

    f[0]=-1;
    int j=0; 
    int k=-1;
    while(j


你可能感兴趣的:(leetcode oj 28 字符串匹配 kmp 下标从0开始 kuangbin模板)