One value
CodeChefOpen on judge ↗
There are n boxes in a row. The i$^t$$^h$ box initially has the value $b_i$. A region can be defined as a range $[i,j]$ $(i \leq j)$ where all the boxes between $i$ and $j$ (inclusive) have the same value. For example, the row $[4,4,4]$ has 1 region, while the row $[7,3,4,4]$ has 3 seperate regions. The game "ONE VALUE" is played on the given row. The player can perform a particular type ope
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