You have stones in a row, each colored Red, Green, or Blue. Your goal: remove the minimum number so no two adjacent stones share the same color. For example, RRGB needs one removal to become RGB.
I'll show you how to solve this by comparing neighbors. The trick is you don't simulate removals. You count violations. This teaches you the pattern of checking consecutive elements in arrays.
Before reading on, think: if you see RRGGB, how many removals do you need? What pattern connects the removal count to matching pairs?