Good Array
CodeChefOpen on judge ↗
Given, an array $[a$1$ , a$2$ , . . . , a$n$]$ of size n consisting of negative integers including zero. The array is called ***good*** if there exists 1 ≤ k ≤ n such that, the elements of the array are monotonically decreasing up to the kth element of then monotonically increasing after the kth element i.e. $∀ 1 ≤ i ≤ k-1, a$i$ i+1$, and, ∀ k ≤ i ≤ n-1, a$i$ > a$i+1. We can perform the followi
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.
Sign in to chat with the tutor and save your progress.
Sign in to start