supply stickers to people children sitting in a circle. The first child gets 1 sticker, the second gets 2, and so on: each handout is one sticker larger than the previous one. After the last child, the host goes back to the first without resetting the count, so the first child gets people + 1 in the second round.
When there are not enough stickers left for a full handout, the child whose turn it is takes everything that remains, and the handout ends.
Return an array of length people with the number of stickers each child ends up with.supply=12, people=3 → [5, 4, 3]
First round: 1, 2, 3 (6 left). Second round: the first person gets 4 (2 left), the second is due 5 but gets the last 2. Result [5, 4, 3].
supply=4, people=5 → [1, 2, 1, 0, 0]
The first person gets 1, the second 2, the third the remaining 1, and the rest get nothing.
supply=1, people=1 → [1]
supply=12, people=3
[5, 4, 3]
Run checks the first 3 tests in your browser. Submit checks all 90 tests on the server, hidden ones included.