Python One Pass O(1) Solution
```\nclass Solution:\n    def timeRequiredToBuy(self, tickets: List[int], k: int) -> int:\n        \n        x=tickets[k]\n        answer=0\n        for i in ra
```\nclass Solution:\n    def timeRequiredToBuy(self, tickets: List[int], k: int) -> int:\n        \n        x=tickets[k]\n        answer=0\n        for i in range(0,k+1):\n            answer+=min(x,tickets[i])\n        \n        for i in range(k+1,len(tickets)):\n            answer+=min(x-1,tickets[i]) \n        \n        return answer
['Python', 'Python3']