当前位置:网站首页>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)
边栏推荐
- 【Confluence】JVM内存调整
- Automatic classification of defective photovoltaic module cells in electroluminescence images-论文阅读笔记
- 让这个 CRMEB 单商户微信商城系统火起来,太好用了!
- LeetCode力扣(剑指offer 36-39)36. 二叉搜索树与双向链表37. 序列化二叉树38. 字符串的排列39. 数组中出现次数超过一半的数字
- Cloud 组件发展升级
- Compiler optimization (4): inductive variables
- 831. KMP字符串
- ASP.NET学习& asp‘s one word
- Notes...
- 9 atomic operation class 18 Rohan enhancement
猜你喜欢
Automatic classification of defective photovoltaic module cells in electroluminescence images-论文阅读笔记
微信公众号OAuth2.0授权登录并显示用户信息
PMP每日一练 | 考试不迷路-7.7
vulnhub之Funfox2
Openeuler prize catching activities, to participate in?
Leetcode force buckle (Sword finger offer 36-39) 36 Binary search tree and bidirectional linked list 37 Serialize binary tree 38 Arrangement of strings 39 Numbers that appear more than half of the tim
最多可以参加的会议数目[贪心 + 优先队列]
mock.js从对象数组中任选数据返回一个数组
Detailed explanation of Flink parallelism and slot
Implement secondary index with Gaussian redis
随机推荐
[sword finger offer] sword finger offer II 012 The sum of left and right subarrays is equal
Chapter 20 using work queue manager (3)
gorilla官方:golang开websocket client的示例代码
CSDN syntax description
841. 字符串哈希
RESTAPI 版本控制策略【eolink 翻译】
R语言ggplot2可视化:使用ggpubr包的ggstripchart函数可视化分组点状条带图(dot strip plot)、设置position参数配置不同分组数据点的分离程度
pom. XML configuration file label: differences between dependencies and dependencymanagement
vulnhub之school 1
[auto.js] automatic script
Time tools
ASP. Net gymnasium integrated member management system source code, free sharing
开源OA开发平台:合同管理使用手册
sql 常用优化
强化学习-学习笔记8 | Q-learning
9 atomic operation class 18 Rohan enhancement
剑指 Offer II 013. 二维子矩阵的和
ASP.NET幼儿园连锁管理系统源码
浏览积分设置的目的
Boot 和 Cloud 的版本选型