Hill Sequence
A sequence $A_1, A_2, \dots, A_N$ of length $N$ is called *good* if any one of the following hold: - The sequence is strictly increasing, or - The sequence is strictly decreasing, or - There exists an index $i\;(1 \lt i \lt N)$ such that: - $A_j \lt A_{j+1}$, for each $1 \le j \lt i$ - $A_j \gt A_{j+1}$, for each $i \le j \lt N$ For example, the sequences $[3, 5, 9]$, $[2, 1]$, $[5, 7,
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