Skip to main content

Practice · 5 of 5

Longest Non-Decreasing Run

CHALLENGE
Difficulty: intermediate+25 XP

**Description:** Print the length of the longest contiguous non-decreasing run in the array. **Input:** Line 1: n (1 <= n <= 100000). Line 2: n integers (|a[i]| <= 10^9). **Output:** One integer — the longest run length. **Example:** 6 / 1 2 2 1 3 4 -> 3 (1 3 4).

Back to lesson: Practice: Dynamic Programming Problem Set