ā back to unit
Medium
# 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...