当前位置:网站首页>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)
边栏推荐
猜你喜欢

YoloV6:YoloV6+Win10---训练自己得数据集

Ways to improve the utilization of openeuler resources 01: Introduction

使用高斯Redis实现二级索引

el-upload上传组件的动态添加;el-upload动态上传文件;el-upload区分文件是哪个组件上传的。

Openeuler prize catching activities, to participate in?

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

国家网信办公布《数据出境安全评估办法》:累计向境外提供10万人信息需申报

项目经理『面试八问』,看了等于会了

编译器优化那些事儿(4):归纳变量

数据孤岛是企业数字化转型遇到的第一道险关
随机推荐
Semantic SLAM源码解析
# 欢迎使用Markdown编辑器
Sword finger offer II 013 Sum of two-dimensional submatrix
2022如何评估与选择低代码开发平台?
Navicat连接2002 - Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘解决
Equals method
LC: string conversion integer (ATOI) + appearance sequence + longest common prefix
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
JVM GC垃圾回收简述
Interpretation of transpose convolution theory (input-output size analysis)
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
UCloud是基础云计算服务提供商
Dynamic addition of El upload upload component; El upload dynamically uploads files; El upload distinguishes which component uploads the file.
8 CAS
力扣 989. 数组形式的整数加法
[auto.js] automatic script
Kubernetes——kubectl命令行工具用法详解
Cuda版本不一致,编译apex报错
Some important knowledge of MySQL
注解。。。