Trains the technique from
LeetCode 950Reveal Cards In Increasing OrderThis 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 stack of tags is held face down and dealt like this, over and over until nothing is left:
Return an arrangement of the very same tags, listed from top to bottom, whose dealing sets them aside in increasing order. Exactly one arrangement does that.
Example 1
Dealing this arrangement sets aside 1, moves 3 to the bottom, sets aside 2, moves 4 to the bottom, sets aside 3 and finally sets aside 4.
Example 2
One tag is set aside straight away with nothing to move.
Example 3
The smaller tag goes on top and is set aside first, then the other is moved to the bottom and set aside next.
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 deck_revealed_increasing(tags: list[int]) -> list[int]:public int[] deckRevealedIncreasing(int[] tags)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.