You are given an integer array tickets where tickets[i] is the number of tickets the
At each second, the person at the front of the queue buys exactly one ticket, decreasing their remaining count by
Given an index k, return the total number of seconds required until the person who initially starts at position k has purchased all of their tickets.
Note: The index
krefers to the person’s original position in the initial queue.
Constraints:
You are given an integer array tickets where tickets[i] is the number of tickets the
At each second, the person at the front of the queue buys exactly one ticket, decreasing their remaining count by
Given an index k, return the total number of seconds required until the person who initially starts at position k has purchased all of their tickets.
Note: The index
krefers to the person’s original position in the initial queue.
Constraints: