Trains the technique from
LeetCode 1929Concatenation of ArrayThis is an original problem, written from a brief that listed the technique, the difficulty, the topics, the function shape and the input bounds — none of that problem's wording, examples, hints or editorials. The link is there so you can map your practice onto the standard set.
Same function shape, different story and different numbers.
A stadium ribbon screen fills each break by running its clip roster through twice, back to back. The roster arrives as the array clips, holding clip ids in the order the operator queued them.
Return the full playout order for one break. If the roster holds n clips, the answer has length 2 * n: slot i plays clips[i], and slot i + n plays clips[i] again. The roster is queued as-is, so a clip listed twice plays in both of its slots on each cycle, and the second cycle runs forward in the same direction as the first.
Example 1
Three clips fill six slots. The second cycle repeats the roster in its original direction, so slot 3 replays the clip from slot 0.
Example 2
The operator queued the same clip twice, and both entries survive into both cycles, giving four slots.
Example 3
A one-clip roster fills a two-slot break.
The editor is preloaded with this. It matches the parent problem's shape, so a solution that works here transfers to a judge unchanged.
def two_cycle_playout(clips: list[int]) -> list[int]:public int[] twoCyclePlayout(int[] clips)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.