[CPP] || Queue || Easiest Solution
\n# Code\n\nclass Solution {\npublic:\n    int timeRequiredToBuy(vector<int>& tickets, int k) {\n        int time=0;\n        queue<int> q;\n        int n=ticke
\n# Code\n```\nclass Solution {\npublic:\n    int timeRequiredToBuy(vector<int>& tickets, int k) {\n        int time=0;\n        queue<int> q;\n        int n=tickets.size();\n        for(int i=0;i<n;i++) q.push(i);\n\n        while(true)\n        {\n            if(tickets[k]==0) break;\n            int curr=q.front();\n            time++;\n            tickets[curr]--;\n            q.pop();\n            if(tickets[curr]!=0) \n            {\n                q.push(curr);\n            }\n        }\n        return time;\n    }\n};\n```
['Queue', 'C++']