2024年2月22日

字符串匹配经典问题整理

摘要: KMP算法 1、找出字符串中第一个匹配项的下标 class Solution: def strStr(self, s: str, pattern: str) -> int: if len(pattern) == 0: return 0 ne = [0] * len(pattern) ne[0], k 阅读全文

posted @ 2024-02-22 00:32 sw-lab 阅读(7) 评论(0) 推荐(0) 编辑

导航