![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
面试题
_sansanT
需要真题模拟数据直接和我联系就好了,不用下载。
NLP方向,目前学习事件抽取。
展开
-
KMP算法(Python3实现)
题目描述: KMP算法Python实现 输入描述: 主字符串s=“aababaaab” 模式串 p=“aaac” 输出描述: False 代码: def getNext(s): next=[0]*(len(s)+1) next[0]=-1 i=0 j=-1 while(i<len(s)): if j==-1 or s[i]==s[j]: i+=1 j+=1 next[i]原创 2021-04-06 17:01:41 · 238 阅读 · 0 评论 -
统计字符串中连续字符的个数,若间隔则重新统计。
题目描述: 统计字符串中连续字符的个数 输入描述: abbacdd 输出描述: a_1_b_2_a_1_c_1_d_2 代码: def count(s): i,j=0,0 mylist=[] while(i<len(s)): while(j<len(s) and s[i]==s[j]): j+=1 if j==len(s): mylist.append(s[i]+"_"+str(j-i))原创 2021-04-06 16:54:37 · 269 阅读 · 0 评论