Dsa
Arrays
Medium
Longest Monotonically Increasing Subarray
Given an array of integers, find the length of the longest contiguous subarray that is strictly monotonically increasing.
Input Format:
- The first line contains a single integer n (1 <= n <= 10^6), the size of the array.
- The second line contains n integers, separated by spaces, representing the elements of the array.
Output Format:
- Print a single integer, the length of the longest increasing subarray.
Example:
Input:
8
1 2 3 2 5 6 7 8
Output:
5
Key concepts
arrayssubarraymonotonic
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now