# sorting medium

The Numbered Tickets

The raffle tickets should be exactly 1, 2, 3, … all the way up, in order, no gaps, no repeats. šŸŽŸļø

You get the ticket nums. Print perfect stack if position i holds exactly the number i+1, otherwise bad stack.

Example:

Input: nums = [1, 2, 3, 4] Output: perfect stack

Position 0 holds 1, position 1 holds 2, and so on — every ticket matches its position plus one.

šŸ’” need a hint?

sort-numbered-tickets.pyšŸ”’ given lines are locked — write your code in between
loading...