上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页
摘要: class Solution { public: unordered_set res; // DFS may produce dup result, use set to filter. vector removeInvalidParentheses(string s) { // Calculate rmL and rmR for the numbers o... 阅读全文
posted @ 2018-05-24 15:12 JTechRoad 阅读(144) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ cla... 阅读全文
posted @ 2018-05-23 13:29 JTechRoad 阅读(99) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: vector res; vector addOperators(string num, int target) { if (num.length() == 0) return res; helper(num, target, "", 0, 0, 0); return res; ... 阅读全文
posted @ 2018-05-22 15:05 JTechRoad 阅读(92) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int hIndex(vector& citations) { if (citations.size() == 0) return 0; int i = 0, j = citations.size(); while (i citations[pos]) j... 阅读全文
posted @ 2018-05-22 14:30 JTechRoad 阅读(71) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int hIndex(vector& citations) { int n = citations.size(); vector buck(n+1, 0); for (auto c : citations) { if (c > n) c... 阅读全文
posted @ 2018-05-22 13:37 JTechRoad 阅读(74) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: vector productExceptSelf(vector& nums) { if (nums.size() == 0) return vector(); vector res(nums.size(), 1); for (int i = 1; i = 0; i--) { ... 阅读全文
posted @ 2018-05-22 07:42 JTechRoad 阅读(64) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ cla... 阅读全文
posted @ 2018-05-22 07:33 JTechRoad 阅读(62) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ cla... 阅读全文
posted @ 2018-05-22 07:27 JTechRoad 阅读(56) 评论(0) 推荐(0) 编辑
摘要: Recurision, TLE. DP: 阅读全文
posted @ 2018-05-22 02:58 JTechRoad 阅读(131) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int maximalSquare(vector>& matrix) { int m = matrix.size(); if (m == 0) return 0; int n = matrix[0].size(); if (n == 0) return 0; vector> dp(m+1,... 阅读全文
posted @ 2018-05-21 22:28 JTechRoad 阅读(121) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页