摘要: 459重复的子字符串 https://leetcode.cn/problems/repeated-substring-pattern/ class Solution { public: int* getNext(string s){//创建next[i]为最长相等前后缀长度的next数组 int * 阅读全文
posted @ 2023-01-05 21:47 芝士可乐 阅读(16) 评论(0) 推荐(0)
摘要: 344 反转字符串 https://leetcode.cn/problems/reverse-string/ 双指针 class Solution { public: void reverseString(vector<char>& s) { int left=0;int right=s.size( 阅读全文
posted @ 2023-01-05 15:25 芝士可乐 阅读(16) 评论(0) 推荐(0)