← 返回 meta 的题目列表Longest subarray with at most one decreasing break
类型:online_judge
Given a list of integers, find the longest subarray which is strictly increasing, but allows at most one break, where a break is when an element is less than the previous one.
Input
list: List of integers, representing a list of numbers.
Output
int: Representing the length of the longest subarray.
Example
Input:
list = [1, 3, 5, 4, 7]
Output:
5
Example
Input
list = [1, 3, 5, 4, 7]
Output
5