Good Pairs
CodeChefOpen on judge ↗
Daenerys Targaryen has given an array $a[1...n]$ of length $n$ to Khal Drogo and has asked him to perform a task on this array, but he can't do this task on his own so he has asked you to help him out. A pair $(i, j)$ where $ i,j \in [1, n] $ is said to be good if following conditions are satisfied: - $1)\; i + 1 < j $ - $2)\; a_{i} \neq a_{j} $ - $3)\; min(a_{i + 1}, a_{i + 2},...., a
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