urlname
type
Post
password
SyncToConfluence
category
Leetcode
date
Mar 25, 2023 12:03
slug
c0c591b50339
icon
Button
catalog
summary
tags
Algorithm
动态规划
cover
Status
BusyTime
Status 1
status
Published

题目链接

关键词

{% label 动态规划 green %}、{% label 数组 yellow %}

解析

  • 状态定义:
    • dp[i]:表示以 nums[i] 结尾的最长递增子序列的长度
  • 状态方程:
    • nums[i] > nums[j]: dp[i] = dp[i] = dp[j] + 1
    • nums[i] <= nums[j]: dp[i] = 1

代码

相似题目

Leetcode_1143-最长公共子序列Leetcode_53-最大子数组和
Loading...