上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 28 下一页
摘要: 链接:https://leetcode-cn.com/problems/substring-with-concatenation-of-all-words/ 代码 class Solution { public: vector<int> findSubstring(string s, vector< 阅读全文
posted @ 2020-06-20 16:05 景云ⁿ 阅读(60) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/divide-two-integers/ 代码 class Solution { public: int divide(int dividend, int divisor) { typedef long long LL; vec 阅读全文
posted @ 2020-06-20 15:46 景云ⁿ 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/implement-strstr/ 代码 class Solution { public: int strStr(string haystack, string needle) { int n = haystack.size() 阅读全文
posted @ 2020-06-20 15:26 景云ⁿ 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/remove-element/ 代码 class Solution { public: int removeElement(vector<int>& nums, int val) { int k = 0; for (int i 阅读全文
posted @ 2020-06-19 10:01 景云ⁿ 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/ 代码 class Solution { public: int removeDuplicates(vector<int>& nums) { int k = 阅读全文
posted @ 2020-06-17 16:34 景云ⁿ 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/reverse-nodes-in-k-group/ 代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *n 阅读全文
posted @ 2020-06-17 16:17 景云ⁿ 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/swap-nodes-in-pairs/ 代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; 阅读全文
posted @ 2020-06-17 15:55 景云ⁿ 阅读(46) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/merge-k-sorted-lists/ 代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; 阅读全文
posted @ 2020-06-16 10:29 景云ⁿ 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/generate-parentheses/ 分析 1.任意前缀中左括号数大于等于右括号数; 2.结果中左括号数等于右括号数。 算法(dfs)代码 class Solution { public: vector<string> a 阅读全文
posted @ 2020-06-16 09:51 景云ⁿ 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/merge-two-sorted-lists/ 代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *nex 阅读全文
posted @ 2020-06-16 09:08 景云ⁿ 阅读(81) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 28 下一页