posts - 501,comments - 0,views - 23802

随笔分类 -  LeetCode

上一页 1 2 3 下一页
LeetCode 94. 二叉树的中序遍历()
摘要:20230304 vector push_back() 20230307 &&&& 20230311 顺利通过 20230331 顺利通过 原题解 ###题目 约束 ###题解 ####方法一 class Solution { public: void inorder(TreeNode* root, 阅读全文
posted @ 2023-03-02 19:52 垂序葎草 阅读(11) 评论(0) 推荐(0) 编辑
LeedCode 85. 最大矩形(/)
摘要:20230304 数组记得初始化,for要从后往前 20230331 顺利通过 原题解 ###题目 约束 ###题解 ####解法一 class Solution { public: int maximalRectangle(vector<vector<char>>& matrix) { int m 阅读全文
posted @ 2023-03-02 19:43 垂序葎草 阅读(39) 评论(0) 推荐(0) 编辑
LeetCode 84. 柱状图中最大的矩形(/stack 滑动窗口)
摘要:20230302 顺利通过 20230304 顺利通过 20230311 顺利通过 20230331 -1 -1 原题解 ###题目 约束 ###题解 ####方法一 class Solution { public: int largestRectangleArea(vector<int>& hei 阅读全文
posted @ 2023-02-28 22:09 垂序葎草 阅读(19) 评论(0) 推荐(0) 编辑
LeetCode 79. 单词搜索(/dfs)
摘要:20230314 顺利通过 原题解 ###题目 约束 ###题解 class Solution { public: vector<pair<int, int>> dir{{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; bool dfs(vector<vector<int>>& 阅读全文
posted @ 2023-02-27 18:50 垂序葎草 阅读(22) 评论(0) 推荐(0) 编辑
LeetCode 78. 子集(/)
摘要:20230228 顺利通过 20230301 顺利通过 20230302 顺利通过 20230303 顺利通过 20230307 顺利通过 20230314 顺利通过 原题解 ###题目 约束 ###题解 ####解法一 class Solution { public: vector<int> t; 阅读全文
posted @ 2023-02-27 18:38 垂序葎草 阅读(89) 评论(0) 推荐(0) 编辑
LeetCode75. 颜色分类(/双指针)
摘要:20230302 顺利通过 20230306 顺利通过 20230314 顺利通过 原题解 ###题目 约束 ###题解 ####解法一 class Solution { public: void sortColors(vector<int>& nums) { int n = nums.size() 阅读全文
posted @ 2023-02-26 19:56 垂序葎草 阅读(14) 评论(0) 推荐(0) 编辑
LeetCode72. 编辑距离(/dp)
摘要:20230226 顺利通过 20230227 顺利通过 20230301 顺利通过 20230304 顺利通过 20230314 顺利通过 原题解 ###题目 约束 ###题解 class Solution { public: int minDistance(string word1, string 阅读全文
posted @ 2023-02-26 01:07 垂序葎草 阅读(18) 评论(0) 推荐(0) 编辑
LeetCode70. 爬楼梯(/dp)
摘要:20230226 顺利通过 20230227 顺利通过 20230301 顺利通过 20230304 顺利通过 20230314 顺利通过 原题解 ###题目 约束 ###题解 ####解法一 class Solution { public: int climbStairs(int n) { int 阅读全文
posted @ 2023-02-26 00:34 垂序葎草 阅读(10) 评论(0) 推荐(0) 编辑
LeetCode 64. 最小路径和(/dp)
摘要:20230226 顺利通过 20230228 顺利通过 20230303 顺利通过 20230314 顺利通过 原题解 ###题目 约束 ###题解 class Solution { public: int minPathSum(vector<vector<int>>& grid) { if (gr 阅读全文
posted @ 2023-02-25 01:29 垂序葎草 阅读(11) 评论(0) 推荐(0) 编辑
LeetCode 62. 不同路径(/dp)
摘要:20230226 顺利通过 20230228 顺利通过 20230303 顺利通过 20230314 顺利通过 原题解 ###题目 约束 ###题解 ####解法一 class Solution { public: int uniquePaths(int m, int n) { vector<vec 阅读全文
posted @ 2023-02-25 01:11 垂序葎草 阅读(22) 评论(0) 推荐(0) 编辑
LeetCode56. 合并区间(/)
摘要:20230224 顺利通过 20230225 顺利通过 20230227 顺利通过 20230302 顺利通过 20230314 顺利通过 原题解 ###题目 约束 ###题解 class Solution { public: vector<vector<int>> merge(vector<vec 阅读全文
posted @ 2023-02-23 23:48 垂序葎草 阅读(216) 评论(0) 推荐(0) 编辑
LeetCode 55. 跳跃游戏(/贪心)
摘要:20230225 顺利通过 20230227 顺利通过 20230302 顺利通过 原题解 ###题目 约束 ###题解 class Solution { public: bool canJump(vector<int>& nums) { int n = nums.size(); int right 阅读全文
posted @ 2023-02-23 23:33 垂序葎草 阅读(11) 评论(0) 推荐(0) 编辑
LeetCode 53. 最大子数组和(/dp 线段树)
摘要:20230223 顺利通过 20230224 顺利通过 20230226 顺利通过 20230313 顺利通过 原题解 ###题目 约束 ###题解 ####方法一 class Solution { public: int maxSubArray(vector<int>& nums) { int p 阅读全文
posted @ 2023-02-22 15:23 垂序葎草 阅读(16) 评论(0) 推荐(0) 编辑
LeetCode 49. 字母异位词分组(/hash)
摘要:20230223 顺利通过 20230224 顺利通过 20230226 顺利通过 20230301 顺利通过 20230313 顺利通过 原题解 ###题目 约束 ###题解 ####解法一 class Solution { public: vector<vector<string>> group 阅读全文
posted @ 2023-02-22 13:05 垂序葎草 阅读(23) 评论(0) 推荐(0) 编辑
LeetCode48. 旋转图像(/思维题)
摘要:20230223 顺利通过 20230225 顺利通过 20230228 顺利通过 20230308 顺利通过 原题解 ###题目 约束 ###题解 ####方法一 class Solution { public: void rotate(vector<vector<int>>& matrix) { 阅读全文
posted @ 2023-02-21 18:55 垂序葎草 阅读(25) 评论(0) 推荐(0) 编辑
LeetCode全排列AcWing842. 排列数字(/dfs)
摘要:20230211 顺利通过 20230218 顺利通过 20230220 顺利通过 20230225 顺利通过 20230313 顺利通过 原题解 Acwing同一个题,主要参考写法 ###题目 给定一个不含重复数字的数组 nums ,返回其所有可能的全排列 。你可以按任意顺序 返回答案。 约束 # 阅读全文
posted @ 2023-02-11 02:29 垂序葎草 阅读(12) 评论(0) 推荐(0) 编辑
LeetCode接雨水(/dp 单调栈 双指针)
摘要:20230210 通过,其实还是有点懵 20230211 通过,自己改写了一点好像不是很懵逼了 20230219 通过,改写的多余,if判断过了没必要min再判断一次 20230220 通过 20230224 通过 20230313 通过 原题解 ###题目 给定 n 个非负整数表示每个宽度为 1 阅读全文
posted @ 2023-02-10 04:03 垂序葎草 阅读(17) 评论(0) 推荐(0) 编辑
LeetCode 组合总和(/回溯+剪枝)
摘要:20230218 顺利通过 20230220 顺利通过 20230223 顺利通过 20230313 顺利通过 原题解 ###题目 约束 ###题解 不剪枝 class Solution { public: void dfs(vector<int>& candidates, int target, 阅读全文
posted @ 2023-02-09 03:53 垂序葎草 阅读(11) 评论(0) 推荐(0) 编辑
LeetCode在排序数组中查找元素的第一个和最后一个位置 AcWing 789. 数的范围(/二分查找)
摘要:20230209 顺利完成 20230211 顺利完成 20230219 顺利完成 20230222 顺利完成 20230313 顺利完成 原题解 相关内容辨析及不完整的二分归类 ###题目 约束 ###题解 y总有相关视频讲解(付费版) class Solution { public: vecto 阅读全文
posted @ 2023-02-08 06:20 垂序葎草 阅读(12) 评论(0) 推荐(0) 编辑
LeetCode搜索旋转排序数组(/二分查找)
摘要:20230221 乱试边界写对了 20230308 顺利通过 原题解 ###题目 约束 ###题解 class Solution { public: int search(vector<int>& nums, int target) { int n = nums.size(); int l = 0, 阅读全文
posted @ 2023-02-07 04:13 垂序葎草 阅读(11) 评论(0) 推荐(0) 编辑

上一页 1 2 3 下一页
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示