Concussive Sequence
For a sequence $X$ of length $L \ (L \geq 3)$, we call $X$ a **concussive sequence** if and only if: - For all $i \ (1\lt i \lt L)$, $X_{i-1}\lt X_i \gt X_{i+1}$ or $X_{i-1}\gt X_i \lt X_{i+1}$ holds. You're given a sequence $A$ of length $N$. Your task is to rearrange $A$ to make it a **concussive sequence**. If multiple such rearrangements exist, print any. If no such rearrangement exists,
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