Easy solution || Beats 100.00% of users with C++ || 🔥
\n\nclass Solution {\npublic:\n    int timeRequiredToBuy(vector<int>& tickets, int k) {\n        int n = tickets.size(),count=0;\n        if((k==0) &&(tickets[k
\n```\nclass Solution {\npublic:\n    int timeRequiredToBuy(vector<int>& tickets, int k) {\n        int n = tickets.size(),count=0;\n        if((k==0) &&(tickets[k]==1 || tickets[k]==0)) return tickets[k];\n        while(true){\n            for(int i=0;i<n;i++){\n                if(tickets[k]==0) return count;\n                if(tickets[i]>0) tickets[i]--,count++;\n            }\n            \n        }\n        return -1;\n    }\n};\n```
['C++']