← All problemsSign in

Streak Star

CodeChefRating 1129Open on judge ↗

The **Streak Value** of an array $B$ is defined as the maximum length of a non-decreasing subarray, more formally: $$ \max_{1 \leq i \leq j \leq N} (j - i + 1) \quad \text{where} \quad B_i \leq B_{i+1} \leq B_{i+2} \leq \dots \leq B_j. $$ Chef has an array $A$ of length $N$ and a magical number $X$. You are allowed to perform the following operation at most once: - Select an index $i$, and u

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start