摘要:
39题组合总数也可以用这种模式 class Solution { public: vector<vector<int>> res; vector<vector<int>> permute(vector<int>& nums) { if(nums.size()==0) return res; vect 阅读全文
posted @ 2021-07-16 17:20
三一一一317
阅读(20)
评论(0)
推荐(0)
摘要:
解析参见: https://leetcode-cn.com/problems/trapping-rain-water/solution/jie-yu-shui-by-leetcode/327718/ class Solution { public: int trap(vector<int>& hei 阅读全文
posted @ 2021-07-16 16:04
三一一一317
阅读(33)
评论(0)
推荐(0)
摘要:
看到此题回想到用回溯法枚举可能的情况。 class Solution { public: vector<vector<int>> res; vector<vector<int>> combinationSum(vector<int>& candidates, int target) { if(can 阅读全文
posted @ 2021-07-16 15:07
三一一一317
阅读(21)
评论(0)
推荐(0)
摘要:
class Solution { public: vector<int> searchRange(vector<int>& nums, int target) { vector<int> res; int left = lcoateleft(nums,0,nums.size()-1,target); 阅读全文
posted @ 2021-07-16 13:41
三一一一317
阅读(35)
评论(0)
推荐(0)
摘要:
class Solution { public: int search(vector<int>& nums, int target) { int len = nums.size(); // if(len<2) // return 0; int left = 0; int right = len-1; 阅读全文
posted @ 2021-07-16 13:03
三一一一317
阅读(26)
评论(0)
推荐(0)