01 2024 档案

摘要:(想法偏了,以后回来重写) 官方解答: class Solution { public: bool repeatedSubstringPattern(string s) { return (s + s).find(s, 1) != s.size(); } }; 阅读全文
posted @ 2024-01-05 17:09 joyfulest 阅读(2) 评论(0) 推荐(0) 编辑
摘要:我的答案: class Solution { public: bool isAnagram(string s, string t) { int s1 = 0; int t1 = 0; for (char ss : s) { s1 += ss; } for (char tt : t) { t1 += 阅读全文
posted @ 2024-01-04 11:28 joyfulest 阅读(4) 评论(0) 推荐(0) 编辑
摘要:正常是应该手写KMP算法 哈哈哈哈 一道题算一天 ,最后先搁置吧,看完kmp再写 代码: class Solution { public: int strStr(string haystack, string needle) { return haystack.find(needle); } }; 阅读全文
posted @ 2024-01-03 16:29 joyfulest 阅读(2) 评论(0) 推荐(0) 编辑
摘要:我的答案: class Solution { public: char findTheDifference(string s, string t) { int s1 = 0, t1 = 0, val = 0; for (char ss : s) { int asciiValue = static_c 阅读全文
posted @ 2024-01-02 14:11 joyfulest 阅读(4) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示