#C14228. Longest Increasing Contiguous Subsequence
Longest Increasing Contiguous Subsequence
Longest Increasing Contiguous Subsequence
Problem Description:
You are given an array of integers. Your task is to find the longest contiguous subsequence (segment) where each number is strictly greater than its previous number. In mathematical terms, find the maximal segment (a_l, a_{l+1}, \dots, a_r) such that for every index (i) with (l \le i < r), it holds that (a_i < a_{i+1}).
If the array is empty, the output should be an empty sequence. In the case where all elements are the same or no two consecutive elements satisfy the strict inequality, the answer is any single element (specifically, the first one by default).
inputFormat
Input Format:
The first line contains a single integer (n), representing the number of elements in the array.
The second line contains (n) space-separated integers.
outputFormat
Output Format:
Output the longest contiguous subsequence that is strictly increasing, with each integer separated by a single space. If the array is empty, output an empty line.## sample
9
1 2 3 2 4 5 6 2 3
2 4 5 6