当前位置:网站首页>力扣674. 最长连续递增序列
力扣674. 最长连续递增序列
2022-07-07 17:53:00 【Tomorrowave】
674. 最长连续递增序列
给定一个未经排序的整数数组,找到最长且 连续递增的子序列,并返回该序列的长度。
连续递增的子序列 可以由两个下标 l 和 r(l < r)确定,如果对于每个 l <= i < r,都有 nums[i] < nums[i + 1] ,那么子序列 [nums[l], nums[l + 1], …, nums[r - 1], nums[r]] 就是连续递增子序列。
###涉及知识点
动态规划
class Solution:
def findLengthOfLCIS(self, nums: List[int]) -> int:
ans=[1 for _ in range(len(nums))]
for i in range(1,len(nums)):
if nums[i]>nums[i-1]:
ans[i]=ans[i-1]+1
return max(ans)
边栏推荐
- Throughput
- R language ggplot2 visualization: use the ggqqplot function of ggpubr package to visualize the QQ graph (Quantitative quantitative plot)
- Semantic SLAM源码解析
- R language ggplot2 visualization: use the ggecdf function of ggpubr package to visualize the grouping experience cumulative density distribution function curve, and the linetype parameter to specify t
- R language ggplot2 visualization: use the ggviolin function of ggpubr package to visualize the violin diagram, set the palette parameter to customize the filling color of violin diagrams at different
- J ü rgen schmidhub reviews the 25th anniversary of LSTM papers: long short term memory All computable metaverses. Hierarchical reinforcement learning (RL). Meta-RL. Abstractions in generative adversar
- openEuler 有奖捉虫活动,来参与一下?
- [confluence] JVM memory adjustment
- Some arrangements about oneself
- UCloud是基础云计算服务提供商
猜你喜欢
Kunpeng developer summit 2022 | Kirin Xin'an and Kunpeng jointly build a new ecosystem of computing industry
谷歌seo外链Backlinks研究工具推荐
Nunjuks template engine
【STL】vector
干货分享|DevExpress v22.1原版帮助文档下载集合
YoloV6:YoloV6+Win10---训练自己得数据集
让这个 CRMEB 单商户微信商城系统火起来,太好用了!
开源OA开发平台:合同管理使用手册
国家网信办公布《数据出境安全评估办法》:累计向境外提供10万人信息需申报
微信公众号OAuth2.0授权登录并显示用户信息
随机推荐
Ways to improve the utilization of openeuler resources 01: Introduction
openEuler 资源利用率提升之道 01:概论
【STL】vector
tp6 实现佣金排行榜
Empowering smart power construction | Kirin Xin'an high availability cluster management system to ensure the continuity of users' key businesses
Chapter 9 Yunji datacanvas was rated as 36 krypton "the hard core technology enterprise most concerned by investors"
Cloud component development and upgrading
Detailed explanation of Flink parallelism and slot
R language ggplot2 visualization: use the ggstripchart function of ggpubr package to visualize the dot strip plot, set the position parameter, and configure the separation degree of different grouped
ASP.NET幼儿园连锁管理系统源码
一锅乱炖,npm、yarn cnpm常用命令合集
841. 字符串哈希
gorilla官方:golang开websocket client的示例代码
R语言ggplot2可视化:使用ggpubr包的ggqqplot函数可视化QQ图(Quantile-Quantile plot)
吞吐量Throughout
Mysql, sqlserver Oracle database connection mode
R语言使用ggplot2函数可视化需要构建泊松回归模型的计数目标变量的直方图分布并分析构建泊松回归模型的可行性
毕业季|遗憾而又幸运的毕业季
R语言fpc包的dbscan函数对数据进行密度聚类分析、查看所有样本的聚类标签、table函数计算聚类簇标签与实际标签构成的二维列联表
Interpretation of transpose convolution theory (input-output size analysis)