Array
3208. Alternating Groups II
Given a circular array colors of 0 (red) and 1 (blue) and a number k. An "alternating group" is k consecutive tiles around the circle where every two adjacent tiles differ in color. Count such groups.
Loading…
Given a circular array colors of 0 (red) and 1 (blue) and a number k. An "alternating group" is k consecutive tiles around the circle where every two adjacent tiles differ in color. Count such groups.
Loading…