offer 55 ii
剑指 Offer 19. 正则表达式匹配(困难)
题目: ![](https://img2023.cnblogs.com/blog/2679751/202308/2679751-20230828224953017-382603316.png) ``` class Solution { public: bool isMatch(string s, s ......
剑指 Offer 10- II. 青蛙跳台阶问题(简单)
题目: ![](https://img2023.cnblogs.com/blog/2679751/202308/2679751-20230828214159429-355812566.png) ``` class Solution { public: int numWays(int n) { vec ......
剑指Offer 34. 二叉树中和为某一值的路径
**题目链接:** [剑指Offer 34. 二叉树中和为某一值的路径](https://leetcode.cn/problems/er-cha-shu-zhong-he-wei-mou-yi-zhi-de-lu-jing-lcof/?envType=study-plan-v2&envId=codi ......
剑指Offer 33. 二叉搜索树的后序遍历序列
**题目链接:** [剑指Offer 33. 二叉搜索树的后序遍历序列](https://leetcode.cn/problems/er-cha-sou-suo-shu-de-hou-xu-bian-li-xu-lie-lcof/description/?envType=study-plan-v2& ......
Leetcode 55
class Solution: def canJump(self, nums: List[int]) -> bool: if len(nums) == 1:return True i = 0;j = i for i in range(100000): if j > i+nums[i]:pass el ......
剑指Offer 32 - III. 从上到下打印二叉树
**题目链接:** [剑指Offer 32 - III. 从上到下打印二叉树](https://leetcode.cn/problems/cong-shang-dao-xia-da-yin-er-cha-shu-iii-lcof/description/?envType=study-plan-v2& ......
剑指Offer 32 - II. 从上到下打印二叉树 II
**题目链接:** [剑指Offer 32 - II. 从上到下打印二叉树 II](https://leetcode.cn/problems/cong-shang-dao-xia-da-yin-er-cha-shu-ii-lcof/description/?envType=study-plan-v2 ......
剑指Offer 31. 栈的压入、弹出序列
**题目链接:** [剑指Offer 31. 栈的压入、弹出序列](https://leetcode.cn/problems/zhan-de-ya-ru-dan-chu-xu-lie-lcof/description/?envType=study-plan-v2&envId=coding-inter ......
剑指 Offer 61. 扑克牌中的顺子(简单)
题目: ![](https://img2023.cnblogs.com/blog/2679751/202308/2679751-20230827203453610-1403573288.png) ``` class Solution { public: bool isStraight(vector& ......
剑指Offer 32 - I. 从上到下打印二叉树
**题目链接:** [剑指Offer 32 - I. 从上到下打印二叉树](https://leetcode.cn/problems/cong-shang-dao-xia-da-yin-er-cha-shu-lcof/description/?envType=study-plan-v2&envId= ......
剑指 Offer 40. 最小的k个数(简单)
题目: ![](https://img2023.cnblogs.com/blog/2679751/202308/2679751-20230827201039153-650004416.png) ``` class Solution { public: vector getLeastNumbers(v ......
剑指Offer 30. 包含min函数的栈
**题目链接:** [剑指Offer 30. 包含min函数的栈](https://leetcode.cn/problems/bao-han-minhan-shu-de-zhan-lcof/description/?envType=study-plan-v2&envId=coding-intervi ......
剑指 Offer 17. 打印从1到最大的n位数(简单)
题目: ![](https://img2023.cnblogs.com/blog/2679751/202308/2679751-20230827195127102-585324581.png) ``` class Solution { public: vector printNumbers(int ......
剑指Offer 29. 顺时针打印矩阵
**题目链接:** [剑指Offer 29. 顺时针打印矩阵](https://leetcode.cn/problems/shun-shi-zhen-da-yin-ju-zhen-lcof/?envType=study-plan-v2&envId=coding-interviews) **题目描述: ......
剑指Offer 28. 对称的二叉树
**题目链接:** [剑指Offer 28. 对称的二叉树](https://leetcode.cn/problems/dui-cheng-de-er-cha-shu-lcof/description/?envType=study-plan-v2&envId=coding-interviews) * ......
剑指Offer 27. 二叉树的镜像
**题目链接:** [剑指Offer 27. 二叉树的镜像](https://leetcode.cn/problems/er-cha-shu-de-jing-xiang-lcof/description/?envType=study-plan-v2&envId=coding-interviews) ......
剑指Offer 26. 树的子结构
**题目链接:** [剑指Offer 26. 树的子结构](https://leetcode.cn/problems/shu-de-zi-jie-gou-lcof/description/?envType=study-plan-v2&envId=coding-interviews) **题目描述:* ......
剑指Offer 25. 合并两个排序的链表
**题目链接:** [剑指Offer 25. 合并两个排序的链表](https://leetcode.cn/problems/he-bing-liang-ge-pai-xu-de-lian-biao-lcof/?envType=study-plan-v2&envId=coding-interview ......
剑指Offer 22. 链表中倒数第k个节点
**题目链接:** [剑指Offer 22. 链表中倒数第k个节点](https://leetcode.cn/problems/lian-biao-zhong-dao-shu-di-kge-jie-dian-lcof/?envType=study-plan-v2&envId=coding-inter ......
剑指 Offer 68 - II. 二叉树的最近公共祖先(简单)
题目: ![](https://img2023.cnblogs.com/blog/2679751/202308/2679751-20230826202719427-1395383638.png) ``` class Solution { public: TreeNode* lowestCommonA ......
剑指 Offer 55 - II. 平衡二叉树(简单)
题目: ![](https://img2023.cnblogs.com/blog/2679751/202308/2679751-20230826201444541-1688679212.png) ![](https://img2023.cnblogs.com/blog/2679751/202308/ ......
剑指Offer 21. 调整数组顺序使奇数位于偶数前面
**题目链接:** [剑指Offer 21. 调整数组顺序使奇数位于偶数前面](https://leetcode.cn/problems/diao-zheng-shu-zu-shun-xu-shi-qi-shu-wei-yu-ou-shu-qian-mian-lcof/description/?en ......
剑指Offer 20. 表示数值的字符串
**题目链接:** [剑指Offer 20. 表示数值的字符串](https://leetcode.cn/problems/biao-shi-shu-zhi-de-zi-fu-chuan-lcof/description/?envType=study-plan-v2&envId=coding-int ......
剑指Offer 18. 删除链表的节点
**题目链接:** [剑指Offer 18. 删除链表的节点](https://leetcode.cn/problems/shan-chu-lian-biao-de-jie-dian-lcof/description/?envType=study-plan-v2&envId=coding-inter ......
剑指Offer 17. 打印从1到最大的n位数
**题目链接:** [剑指Offer 17. 打印从1到最大的n位数](https://leetcode.cn/problems/da-yin-cong-1dao-zui-da-de-nwei-shu-lcof/description/?envType=study-plan-v2&envId=cod ......
剑指Offer 16. 数值的整数次方
**题目链接:** [剑指Offer 16. 数值的整数次方](https://leetcode.cn/problems/shu-zhi-de-zheng-shu-ci-fang-lcof/?envType=study-plan-v2&envId=coding-interviews) **题目描述: ......
剑指Offer 15. 二进制中1的个数
**题目链接:** [剑指Offer 15. 二进制中1的个数](https://leetcode.cn/problems/er-jin-zhi-zhong-1de-ge-shu-lcof/description/?envType=study-plan-v2&envId=coding-intervi ......
剑指Offer 14- II. 剪绳子 II
**题目链接:** [剑指Offer 14- II. 剪绳子 II](https://leetcode.cn/problems/jian-sheng-zi-ii-lcof/?envType=study-plan-v2&envId=coding-interviews) **题目描述:** 给你一根长度 ......
Leetcode 454. 四数相加 II(4sum ii)
[题目链接](https://leetcode.cn/problems/4sum-ii) 给你四个整数数组 nums1、nums2、nums3 和 nums4 ,数组长度都是 n ,请你计算有多少个元组 (i, j, k, l) 能满足: - 0 nums1[0] + nums2[0] + nums ......
剑指 Offer 59 - I. 滑动窗口的最大值
题不难,但理解思路很重要。 做法是单调队列。 如果求滑动窗口的最大值,那么必须在单调队列保持严格单调递减(只能小于,小于等于也不行),为啥不行还不是很清楚。 并且,单调队列一定存储的是数组的索引!!否则无法确定滑动窗口的开始位置以及开始时的队列存储最大值的情况。 class Solution { p ......