摘要:
题解 Easy | Hashmap class Solution { public: vector<int> twoSum(vector<int>& numbers, int target) { unordered_map<int, int> m; for(int i = 0; i < number 阅读全文
摘要:
题解 Medium | Backtracking class Solution { public: vector<vector<int>> subsetsWithDup(vector<int>& nums) { sort(nums.begin(), nums.end()); vector<vecto 阅读全文
摘要:
题解 Medium | Backtracking class Solution { public: vector<vector<int>> subsets(vector<int>& nums) { sort(nums.begin(), nums.end()); vector<vector<int>> 阅读全文
摘要:
题解 Medium | Backtracking class Solution { public: int getMaximumGold(vector<vector<int>>& grid) { int ret = 0; for(int i = 0; i < grid.size(); i++) { 阅读全文
摘要:
题解 Medium | Backtracking class Solution { public: vector<vector<int>> combinationSum3(int k, int n) { vector<vector<int>> sols; vector<int> sol; helpe 阅读全文
摘要:
题解 Medium | Backtracking class Solution { public: vector<vector<int>> combinationSum2(vector<int>& candidates, int target) { sort(candidates.begin(), 阅读全文
摘要:
题解 Medium | Backtracking class Solution { public: vector<vector<int>> combinationSum(vector<int>& candidates, int target) { vector<vector<int>> sols; 阅读全文
摘要:
题解 Medium | Backtracking 经典的排列组合题,使用回溯法。必须熟练。 class Solution { public: vector<vector<int>> combine(int n, int k) { vector<vector<int>> combinations; v 阅读全文