Simple C++ solution || 0ms
This is easy to understand solution..\nDo give a like!.\n\n\n\n    int timeRequiredToBuy(vector& tickets, int k) {\n    int n=tickets.size(),ans=0;\n    \n    f
This is easy to understand solution..\nDo give a like!.\n\n\n\n    int timeRequiredToBuy(vector<int>& tickets, int k) {\n    int n=tickets.size(),ans=0;\n    \n    for(int i=0;i<n;i++)\n    {\n        if(i>k)\n            ans+=min(tickets[i],tickets[k]-1);\n        else if(i<k)\n            ans+=min(tickets[i],tickets[k]);\n        else\n            ans+=tickets[k];\n                \n    }\n        \n    return ans;\n    }\n};
[]