← All problemsSign in

3208. Alternating Groups II

LeetCodeArraySliding WindowOpen on judge ↗

There is a circle of red and blue tiles. You are given an array of integers colors and an integer k. 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. An alternating group is every k contiguous tiles in the circle with alternating colors (each tile in the group except the first and last one has a different col

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start