摘要: 2023-11-13 思路: 1 暴力法-枚举 2 字符串匹配 3 kmp class Solution { public boolean repeatedSubstringPattern(String s) { return (s + s).indexOf(s, 1) != s.length(); 阅读全文
posted @ 2023-11-13 22:18 追梦•少年 阅读(10) 评论(0) 推荐(0)
摘要: 2023-11-13 28. 找出字符串中第一个匹配项的下标 - 力扣(LeetCode) 思路2:kmp算法-》求字符串的最大前后缀长度问题 class Solution { public int strStr(String haystack, String needle) { //暴力法 //双 阅读全文
posted @ 2023-11-13 22:14 追梦•少年 阅读(11) 评论(0) 推荐(0)