摘要: 第一种dfs,用例还剩最后一个超时了 class Solution { public: int res = INT_MAX; // int m = 0; // int n = 0; int minimumTotal(vector<vector<int>>& triangle) { // m = tr 阅读全文
posted @ 2021-08-17 21:38 三一一一317 阅读(53) 评论(0) 推荐(0)
摘要: class Solution { public: vector<string> split(string str, string flag){ vector<string> res; int fd = 0; // 注意前面是赋值。fd = str.find(flag) // 后面是判断,如果fd = 阅读全文
posted @ 2021-08-17 20:39 三一一一317 阅读(49) 评论(0) 推荐(0)
摘要: 参考: https://www.bilibili.com/video/BV1Tz4y167pC?from=search&seid=6576840001001728880 class Solution { public: string removeDuplicateLetters(string s) 阅读全文
posted @ 2021-08-17 19:40 三一一一317 阅读(72) 评论(0) 推荐(0)
摘要: class Solution { public: vector<vector<int>> threeSum(vector<int>& nums) { vector<vector<int>> res; sort(nums.begin(), nums.end()); // 排序,方便后续处理 for(i 阅读全文
posted @ 2021-08-17 16:22 三一一一317 阅读(57) 评论(0) 推荐(0)
摘要: class Solution { public: vector<int> addToArrayForm(vector<int>& num, int k) { vector<int> vec; string str_k = to_string(k); // cout<<"num: "<<num.siz 阅读全文
posted @ 2021-08-17 15:32 三一一一317 阅读(48) 评论(0) 推荐(0)