文章
LeetCode 108. 将有序数组转换为二叉搜索树 | Python
108.将有序数组转换为二叉搜索树题目将一个按照升序排列的有序数组,转换为一棵高度平衡二叉搜索树。本题中,一个高度平衡二叉树是指一个二叉树每个节点的左右两个子树的高度差的绝对值不超过1。示例:<pre<code
Leetcode剑指 Offer 47. 礼物的最大价值 Python实现
题目要求:!image.png(https://imghelloworld.osscnbeijing.aliyuncs.com/imgs/0b36293ce371d126589173172cdc42e7.png)思路:创建一个二维数组,用来保存每个格子能取
Leetcode14. 最长公共前缀 Python实现
题目要求:!image.png(https://imghelloworld.osscnbeijing.aliyuncs.com/imgs/b226d78147150401ff3f01229287d08f.png)思路:定义一个flag用来表示当前公共字符串
Leetcode面试题 08.01. 三步问题 Python实现
题目要求:!image.png(https://imghelloworld.osscnbeijing.aliyuncs.com/imgs/a046ef41287bd03faf5eab914345fd62.png)思路:上第一个台阶有一种方法:(1)1
Leetcode剑指 Offer 42. 连续子数组的最大和 Python实现(同53题)
题目要求:!image.png(https://imghelloworld.osscnbeijing.aliyuncs.com/imgs/fa753a05adff36c64dd1a8ffc9b8f0b9.png)思路:维护一个tmp,用来保存临时的最大值
LeetCode 378. 有序矩阵中第K小的元素 | Python
378.有序矩阵中第K小的元素题目来源:力扣(LeetCode)https://leetcodecn.com/problems/kthsmallestelementinasortedmatrix(https://link.segmentfault.com
LeetCode 1290 二进制链表转整数
LeetCode1290二进制链表转整数题目1290.二进制链表转整数(https://link.segmentfault.com/?encJzYDGMsyGeyT3DE3Xb7Ldw%3D%3D.H8Us5gbtEMsI5Ovjkxjoh15qsZg1Lh2gP
Leetcode122. 买卖股票的最佳时机 II Python实现
题目要求:!image.png(https://imghelloworld.osscnbeijing.aliyuncs.com/imgs/adc3e60e44c110d1049cae7df96c4c4a.png)思路:每天都买卖股票,卖出前一天的,再买进当
Leetcode121. 买卖股票的最佳时机 Python实现
题目要求:!image.png(https://imghelloworld.osscnbeijing.aliyuncs.com/imgs/ff43c1d26cb0b5c030fb170558b021c8.png)思路:维护一个res用来保存结果集,维护一个
LeetCode 718. 最长重复子数组 | Python
718.最长重复子数组题目来源:力扣(LeetCode)https://leetcodecn.com/problems/maximumlengthofrepeatedsubarray(https://link.segmentfault.com/?encAa
已加载文章中没有匹配内容,试试其他关键词或清空搜索。