及川彻
及川彻
全部文章
力扣
多线程(1)
归档
标签
去牛客网
登录
/
注册
及川彻的博客
全部文章
/ 力扣
(共6篇)
电话号码的字母组合
回溯法: class Solution { public: //1. 用map记录每个数字按键对应的所有字母 map<char, string> M = { {'2', "abc"}, {'3', "def"}, {...
2020-12-08
3
572
三数之和
排序+双指针 class Solution { public: vector<vector<int>> threeSum(vector<int>& nums) { sort(nums.begin(), nums.end()); ...
2020-11-18
0
487
两数之和
哈希表 class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { unordered_map<int, int> m; ...
2020-11-10
0
565
盛最多水的容器
双指针 class Solution { public: int maxArea(vector<int>& height) { //双指针 int n = height.size(); int left = 0, right...
2020-11-10
1
536
最长回文子串
动态规划 class Solution { public: string longestPalindrome(string s) { if(s.size() < 2) return s; int start = 0, maxlen = 1, n =...
2020-11-09
2
535
LC3:无重复字符的最长子串
双指针+滑动窗口 class Solution { public: int lengthOfLongestSubstring(string s) { if(s.size() == 0) return 0; unordered_set<char> l...
力扣
2020-10-31
0
492