摘要:
class Solution { public: bool canConstruct(string ransomNote, string magazine) { int record[26] ={0}; //默认值为0 if (magazine.size() < ransomNote.size()) 阅读全文
posted @ 2022-09-05 18:18
hjy94wo
阅读(13)
评论(0)
推荐(0)
摘要:
class Solution { public: vector<vector<int>> res; vector<vector<int>> threeSum(vector<int>& nums) { sort(nums.begin(), nums.end()); for (int i = 0; i 阅读全文
posted @ 2022-09-05 18:02
hjy94wo
阅读(26)
评论(0)
推荐(0)
摘要:
class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { unordered_map<int, int> map; for (int i = 0; i < nums.size(); i ++) { aut 阅读全文
posted @ 2022-09-05 17:36
hjy94wo
阅读(16)
评论(0)
推荐(0)
摘要:
class Solution { public: int getSum(int n) { int sum = 0; while (n) { sum += (n % 10) * (n % 10); n /= 10; } return sum; } bool isHappy(int n) { unord 阅读全文
posted @ 2022-09-05 17:15
hjy94wo
阅读(16)
评论(0)
推荐(0)
摘要:
class Solution { public: bool record[1010]; vector<int> res; vector<int> intersection(vector<int>& nums1, vector<int>& nums2) { unordered_set<int> set 阅读全文
posted @ 2022-09-05 16:13
hjy94wo
阅读(20)
评论(0)
推荐(0)
摘要:
class Solution { public: bool isAnagram(string s, string t) { if (s.size() != t.size()) return false; sort(s.begin(), s.end()); sort(t.begin(), t.end( 阅读全文
posted @ 2022-09-05 15:47
hjy94wo
阅读(8)
评论(0)
推荐(0)
摘要:
class Solution { public: vector<vector<int>> res; vector<int> path; int used[10]; void dfs(vector<int>& nums) { if (path.size() == nums.size()) { res. 阅读全文
posted @ 2022-09-05 14:57
hjy94wo
阅读(14)
评论(0)
推荐(0)
摘要:
class Solution { public: vector<vector<int>> res; vector<int> path; bool used[10]; void dfs(vector<int>& nums) { if (path.size() == nums.size()) { res 阅读全文
posted @ 2022-09-05 14:44
hjy94wo
阅读(18)
评论(0)
推荐(0)
摘要:
class Solution { public: vector<vector<int>> res; vector<int> path; int num = -101; void dfs(int start, vector<int>& nums) { if (path.size() > 1) { re 阅读全文
posted @ 2022-09-05 10:51
hjy94wo
阅读(7)
评论(0)
推荐(0)
摘要:
class Solution { public: vector<vector<int>> res; vector<int> path; void dfs(int start, vector<int>& nums) { res.push_back(path); for (int i = start; 阅读全文
posted @ 2022-09-05 10:07
hjy94wo
阅读(13)
评论(0)
推荐(0)
摘要:
class Solution { public: vector<vector<int>> res; vector<int> path; void dfs(int start, vector<int>& nums) { res.push_back(path); for (int i = start; 阅读全文
posted @ 2022-09-05 08:45
hjy94wo
阅读(19)
评论(0)
推荐(0)