Simple While Loop
\n# Code\n\nclass Solution:\n    def timeRequiredToBuy(self, tickets: List[int], k: int) -> int:\n        time = 0\n        i = 0 \n        length = len(tickets
\n# Code\n```\nclass Solution:\n    def timeRequiredToBuy(self, tickets: List[int], k: int) -> int:\n        time = 0\n        i = 0 \n        length = len(tickets)\n        while tickets[k] != 0 :\n            if i == length :\n                i = 0 \n            if tickets[i] != 0 :\n                time += 1\n                tickets[i] -= 1\n            i += 1\n        return time\n\n```
['Python3']