Search
⌘K

Leetcode 3208. Alternating Groups II

Given a circular binary array and integer k, count how many contiguous length-k segments are alternating (every adjacent pair within the segment differs). Because of the circular wrap, this reduces to checking windows where all k-1 internal adjacent pairs are different (a sliding-window over adjacency flags).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.