上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 28 下一页
摘要: 链接:https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array-ii/ 代码 class Solution { public: int removeDuplicates(vector<int>& nums) { int 阅读全文
posted @ 2020-07-14 21:35 景云ⁿ 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/word-search/ 代码 class Solution { public: bool exist(vector<vector<char>>& board, string word) { for (int i = 0; i 阅读全文
posted @ 2020-07-14 21:27 景云ⁿ 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/subsets/ 代码 class Solution { public: vector<vector<int>> subsets(vector<int>& nums) { vector<vector<int>> ans; int 阅读全文
posted @ 2020-07-14 18:56 景云ⁿ 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/combinations/ 代码 class Solution { public: vector<vector<int>> ans; vector<int> path; vector<vector<int>> combine(i 阅读全文
posted @ 2020-07-14 18:34 景云ⁿ 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/minimum-window-substring/ 代码 class Solution { public: string minWindow(string s, string t) { unordered_map<char, i 阅读全文
posted @ 2020-07-14 18:16 景云ⁿ 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/sort-colors/ 代码 class Solution { public: void sortColors(vector<int>& nums) { for (int i = 0, j = 0, k = nums.size 阅读全文
posted @ 2020-07-14 17:52 景云ⁿ 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/search-a-2d-matrix/ 代码 class Solution { public: bool searchMatrix(vector<vector<int>>& matrix, int target) { if (m 阅读全文
posted @ 2020-07-14 17:36 景云ⁿ 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/set-matrix-zeroes/ 代码 class Solution { public: void setZeroes(vector<vector<int>>& matrix) { if (matrix.empty() || 阅读全文
posted @ 2020-07-14 11:29 景云ⁿ 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/edit-distance/ 代码 class Solution { public: int minDistance(string word1, string word2) { int n = word1.size(), m = 阅读全文
posted @ 2020-07-12 10:34 景云ⁿ 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 链接:https://leetcode-cn.com/problems/simplify-path/ 代码 class Solution { public: string simplifyPath(string path) { string ans, name; if (path.back() != 阅读全文
posted @ 2020-07-11 10:50 景云ⁿ 阅读(55) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 28 下一页