# LC2946 Count Alternating Subarrays
Practice note for coding interviews.
An alternating subarray flips 0/1 each step. Extend the current run length and add it to the answer at every index.
Discuss edge cases and complexity in the mock interview.
I used [AI interview copilot](https://www.linkjob.ai/interview-copilot/) while rehearsing this pattern aloud.
Disclosure: personal study notes mentioning a practice tool.