当前位置:网站首页>Force buckle 674 Longest continuous increasing sequence
Force buckle 674 Longest continuous increasing sequence
2022-07-07 20:06:00 【Tomorrowave】
674. The longest continuous increasing sequence
Given an unordered array of integers , Find the longest and Successive increasing subsequences , And return the length of the sequence .
Successive increasing subsequences It can be made up of two subscripts l and r(l < r) determine , If for each l <= i < r, There are nums[i] < nums[i + 1] , So the subsequence [nums[l], nums[l + 1], …, nums[r - 1], nums[r]] It's a continuous increasing subsequence .
### Knowledge points involved
Dynamic programming
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)
边栏推荐
- Version selection of boot and cloud
- Classification automatique des cellules de modules photovoltaïques par défaut dans les images de lecture électronique - notes de lecture de thèse
- Simulate the implementation of string class
- ASP.NET学习& asp‘s one word
- R language ggplot2 visualization: use the ggdensity function of ggpubr package to visualize the packet density graph, and use stat_ overlay_ normal_ The density function superimposes the positive dist
- 银行理财产品怎么买?需要办银行卡吗?
- 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
- Redis——基本使用(key、String、List、Set 、Zset 、Hash、Geo、Bitmap、Hyperloglog、事务 )
- # 欢迎使用Markdown编辑器
- [confluence] JVM memory adjustment
猜你喜欢
让这个 CRMEB 单商户微信商城系统火起来,太好用了!

九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!

Openeuler prize catching activities, to participate in?

Introduction to bit operation

九章云极DataCanvas公司获评36氪「最受投资人关注的硬核科技企业」

The project manager's "eight interview questions" is equal to a meeting

Open source heavy ware! Chapter 9 the open source project of ylarn causal learning of Yunji datacanvas company will be released soon!

el-upload上传组件的动态添加;el-upload动态上传文件;el-upload区分文件是哪个组件上传的。
![最多可以参加的会议数目[贪心 + 优先队列]](/img/f3/e8e939e0393efc404cc159d7d33364.png)
最多可以参加的会议数目[贪心 + 优先队列]

华南X99平台打鸡血教程
随机推荐
力扣 1037.有效的回旋镖
8 CAS
9 原子操作类之18罗汉增强
力扣 1232.缀点成线
JVM 类加载机制
毕业季|遗憾而又幸运的毕业季
力扣 2315.统计星号
线性基
CSDN syntax description
Boot 和 Cloud 的版本选型
831. KMP字符串
我的创作纪念日
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
MySQL、sqlserver oracle数据库连接方式
torch. nn. functional. Pad (input, pad, mode= 'constant', value=none) record
Browse the purpose of point setting
openEuler 有奖捉虫活动,来参与一下?
Equals method
Cloud 组件发展升级
AD域组策略管理