Balanced Tag-Pair Sequence

Asked at OpenAI · Coding Questions · Difficulty: Easy · Last asked Apr 19, 2026

A publisher posts one item per day, and each item carries exactly two of three content tags: `AI`, `Human` and `Task`. Over any stretch of days starting from day 1, the `AI` tag must never get ahead of or fall behind the other two tags by more than one. Build a schedule of `n` days that keeps this balance on every day.

Loading the problem…