当前位置:网站首页>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)
边栏推荐
- 一锅乱炖,npm、yarn cnpm常用命令合集
- 力扣 599. 两个列表的最小索引总和
- Browse the purpose of point setting
- 华南X99平台打鸡血教程
- equals 方法
- openEuler 有奖捉虫活动,来参与一下?
- 关于cv2.dnn.readNetFromONNX(path)就报ERROR during processing node with 3 inputs and 1 outputs的解决过程【独家发布】
- Detailed explanation of Flink parallelism and slot
- 力扣 1232.缀点成线
- pom.xml 配置文件标签作用简述
猜你喜欢

mock. JS returns an array from the optional data in the object array

微信公众号OAuth2.0授权登录并显示用户信息

Ways to improve the utilization of openeuler resources 01: Introduction

Introduction to bit operation

ASP. Net kindergarten chain management system source code

开源OA开发平台:合同管理使用手册

Compiler optimization (4): inductive variables

转置卷积理论解释(输入输出大小分析)

小试牛刀之NunJucks模板引擎

ASP.NET幼儿园连锁管理系统源码
随机推荐
LeetCode_7_5
A pot of stew, a collection of common commands of NPM and yarn cnpm
MSE API学习
实训九 网络服务的基本配置
openEuler 有奖捉虫活动,来参与一下?
The project manager's "eight interview questions" is equal to a meeting
【STL】vector
R语言ggplot2可视化:使用ggpubr包的ggviolin函数可视化小提琴图、设置palette参数自定义不同水平小提琴图的填充色、add参数在小提琴图添加箱图
Welcome to the markdown editor
R语言ggplot2可视化:使用ggpubr包的ggstripchart函数可视化分组点状条带图(dot strip plot)、设置position参数配置不同分组数据点的分离程度
831. KMP字符串
R language uses ggplot2 function to visualize the histogram distribution of counting target variables that need to build Poisson regression model, and analyzes the feasibility of building Poisson regr
PMP practice once a day | don't get lost in the exam -7.7
力扣 599. 两个列表的最小索引总和
pom. Brief introduction of XML configuration file label function
九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
mock.js从对象数组中任选数据返回一个数组
R语言fpc包的dbscan函数对数据进行密度聚类分析、查看所有样本的聚类标签、table函数计算聚类簇标签与实际标签构成的二维列联表
R语言使用ggplot2函数可视化需要构建泊松回归模型的计数目标变量的直方图分布并分析构建泊松回归模型的可行性
CSDN syntax description