算法题目
有流星飞过的日子
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
KMP算法next[j]的一种解释
假设读者已经了解了KMP算法的基本原理: 本文目标:给出一种经典代码中next[j]函数求解过程的解释//KMP算法中next[j] 求解样例void GetNext(int *next, string p){ int j=0,k=-1; next[0]=-1; while(j < p.length()-1) { if(k == -1 || p[j] == p[k]) { j++;k++; ...原创 2021-05-21 17:39:01 · 972 阅读 · 1 评论 -
leetcode: 340 至多包含 K 个不同字符的最长子串
#include <iostream>#include <string>using namespace std;class Solution {public: int findLongestWord(string s, int k) { if(k == 0 || s.size() == 0) return 0; vector<bool> flags(128,false); vect.原创 2021-05-20 16:37:21 · 174 阅读 · 0 评论
分享