上一页 1 2 3 4 5 6 7 8 9 10 ··· 23 下一页
摘要: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solu 阅读全文
posted @ 2021-08-16 19:24 三一一一317 阅读(59) 评论(0) 推荐(0)
摘要: class Solution { public: void nextPermutation(vector<int>& nums) { // 我要比你大,还大的最小 // 较小数尽量靠右, 所以从右往前找 // 较大数尽可能小 int i = nums.size()-2; // 寻找较小数 while 阅读全文
posted @ 2021-08-16 18:55 三一一一317 阅读(35) 评论(0) 推荐(0)
摘要: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : 阅读全文
posted @ 2021-08-16 17:40 三一一一317 阅读(39) 评论(0) 推荐(0)
摘要: class Solution { public: vector<int> fairCandySwap(vector<int>& aliceSizes, vector<int>& bobSizes) { int sum1 = 0; int sum2 = 0; for(int i = 0; i < al 阅读全文
posted @ 2021-08-16 17:16 三一一一317 阅读(45) 评论(0) 推荐(0)
摘要: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : 阅读全文
posted @ 2021-08-16 17:16 三一一一317 阅读(36) 评论(0) 推荐(0)
摘要: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), rig 阅读全文
posted @ 2021-08-15 15:49 三一一一317 阅读(47) 评论(0) 推荐(0)
摘要: class Solution { public: static bool cmp(vector<int> &a, vector<int> &b){ // if(a[0]!=b[0]) return a[0]<b[0]; // else // return a[1]<b[1]; } vector<ve 阅读全文
posted @ 2021-08-15 14:53 三一一一317 阅读(71) 评论(0) 推荐(0)
摘要: class Solution { public: int longestOnes(vector<int>& nums, int k) { unordered_map<int,int> un_map; int sum = 0; int i = 0; int j = 0; for(j = 0; j < 阅读全文
posted @ 2021-08-15 14:20 三一一一317 阅读(43) 评论(0) 推荐(0)
摘要: class Solution { public: vector<vector<int>> findContinuousSequence(int target) { int n = target/2; int i = 1; int j = 1; int sum = 0; vector<vector<i 阅读全文
posted @ 2021-08-15 13:11 三一一一317 阅读(36) 评论(0) 推荐(0)
摘要: // /** // * Definition for a binary tree node. // * struct TreeNode { // * int val; // * TreeNode *left; // * TreeNode *right; // * TreeNode() : val(0 阅读全文
posted @ 2021-08-15 12:35 三一一一317 阅读(75) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 23 下一页