摘要: 需要好好研究各种写法。 C++解法 class Solution { public: vector<vector<string>> groupAnagrams(vector<string>& strs) { vector<vector<string>> result; if (strs.size() 阅读全文
posted @ 2024-02-14 23:14 repinkply 阅读(16) 评论(0) 推荐(0)
摘要: 解题关键点:用递归方法 class Solution { public: vector<string> mapping = { "abc","def","ghi","jkl", "mno","pqrs","tuv","wxyz"}; void combinations(string digits, 阅读全文
posted @ 2024-02-14 20:45 repinkply 阅读(11) 评论(0) 推荐(0)
摘要: 这个题目的有些类似实现 strStr 这个算法题目。 解题关键点: 1.采用类似滑动窗口的算法遍历字符串s。 2.用两个哈希表保存字符串s和字符串p,中每个小写字母出现的次数。 C++代码: class Solution { public: bool equals(vector<int>& sc, 阅读全文
posted @ 2024-02-14 19:19 repinkply 阅读(23) 评论(0) 推荐(0)