
动态规划
文章平均质量分 84
珍妮的选择
这个作者很懒,什么都没留下…
展开
-
从 1 开始被动态规划玩转 (上)
本文通过对一定数量的动态规划问题的分析, 试图找寻求解这类问题的 "规律". 在行文上, 尽量对能使用同一方法解决的问题进行聚类, 然后逐题进行思路分析与解答. 这样的好处是, 当介绍完一种思路后, 可以尝试用该思路去解决相似的问题, 以验证自己的掌握情况.文章不介绍基础的动态规划概念(标题中所谓的 "从 1 开始"), 比如 "重叠子问题"、"最优子结构" 以及 "状态转移方程" 等, 开始选的题目都不难, 可以在做题时可以深刻体会这些概念.............原创 2022-07-31 00:59:52 · 435 阅读 · 0 评论 -
746. Min Cost Climbing Stairs* (使用最小花费爬楼梯)
746. Min Cost Climbing Stairs* (使用最小花费爬楼梯)https://leetcode.com/problems/min-cost-climbing-stairs/题目描述You are given an integer array cost where cost[i] is the cost of ith step on a staircase. Once you pay the cost, you can either climb one or two steps.原创 2021-06-18 10:34:15 · 338 阅读 · 2 评论 -
152. Maximum Product Subarray**(乘积最大子数组)
152. Maximum Product Subarray**(乘积最大子数组)https://leetcode.com/problems/maximum-product-subarray/题目描述Given an integer array nums, find a contiguous non-empty subarray within the array that has the largest product, and return the product.It is guaranteed原创 2021-04-22 00:44:44 · 328 阅读 · 0 评论 -
300. **Longest Increasing Subsequence (最长递增子序列)
300. **Longest Increasing Subsequence (最长递增子序列)https://leetcode.com/problems/longest-increasing-subsequence/description/题目描述Given an integer array nums, return the length of the longest strictly increasing subsequence.A subsequence is a sequence that c原创 2021-03-05 00:31:21 · 332 阅读 · 1 评论 -
64. Minimum Path Sum**(最小路径和)
64. Minimum Path Sum** (最小路径和)https://leetcode.com/problems/minimum-path-sum/题目描述Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only mov原创 2021-03-04 00:47:15 · 572 阅读 · 2 评论 -
53. Maximum Subarray*(最大子序和)
53. Maximum Subarray* (最大子序和)https://leetcode.com/problems/maximum-subarray/题目描述Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.Example 1:Input: nums = [-2,1,-3,4,原创 2021-03-04 00:00:44 · 280 阅读 · 2 评论 -
63. **Unique Paths II
63. **Unique Paths IIhttps://leetcode.com/problems/unique-paths-ii/description/题目描述Follow up for 62. Unique Paths**:Now consider if some obstacles are added to the grids. How many unique paths wou...原创 2019-12-05 09:51:43 · 271 阅读 · 0 评论 -
62. Unique Paths**
62. Unique Paths**https://leetcode.com/problems/unique-paths/题目描述A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down...原创 2019-12-04 22:39:26 · 197 阅读 · 0 评论 -
338. Counting Bits**
338. Counting Bits**https://leetcode.com/problems/counting-bits/题目描述Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary...原创 2020-03-27 08:51:28 · 285 阅读 · 0 评论 -
70. Climbing Stairs*
70. Climbing Stairs*https://leetcode.com/problems/climbing-stairs/题目描述You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many d...原创 2020-03-25 08:13:18 · 280 阅读 · 0 评论 -
300. Longest Increasing Subsequence**
300. Longest Increasing Subsequence**https://leetcode.com/problems/longest-increasing-subsequence/题目描述Given an unsorted array of integers, find the length of longest increasing subsequence.Example...原创 2020-03-24 09:00:27 · 271 阅读 · 0 评论 -
198. House Robber*
198. House Robber*https://leetcode.com/problems/house-robber/题目描述You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only cons...原创 2020-03-26 23:47:26 · 255 阅读 · 0 评论