3206. Alternating Groups I
There is a circle of red and blue tiles. You are given an array of integers colors. The color of tile i is represented by colors[i]: - colors[i] == 0 means that tile i is red. - colors[i] == 1 means that tile i is blue. Every 3 contiguous tiles in the circle with alternating colors (the middle tile has a different color from its left and right tiles) is called an alternating group. Return the
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