C++ Simulation. No math because I suck at math.
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nSimulation\n\n# Complexity\n- Time complexity:\n O(n*tickets[k]) \n\n- Sp
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nSimulation\n\n# Complexity\n- Time complexity:\n $$O(n*tickets[k])$$ \n\n- Space complexity:\n $$O(n)$$\n\n# Code\n```\nclass Solution {\npublic:\n    int timeRequiredToBuy(vector<int>& wingstopWings, int k) {\n        \n        using pii = pair<int, int>;\n        // {tickets, og_index}\n        queue<pii> q;\n        int n = wingstopWings.size();\n        for(int i = 0; i < n; i++) {\n            q.push({wingstopWings[i], i});\n        }\n        int time = 0;\n        while(!q.empty()) {\n            auto [num_tickets, og_i] = q.front();\n            q.pop();\n            num_tickets--;\n            time++;\n            if(og_i == k && num_tickets == 0) {\n                return time;\n            }\n            if(num_tickets > 0) {\n                q.push({num_tickets, og_i});\n            }\n        }\n        return time;\n    }\n};\n```
['Simulation', 'C++']