[Beginner friendly][faster than 100.00%][c++][easy understanding]
\nclass Solution {\npublic:\n    int countStudents(vector<int>& students, vector<int>& sandwiches) {\n        std::queue q(std::deque<int>(students.begin(), stu
```\nclass Solution {\npublic:\n    int countStudents(vector<int>& students, vector<int>& sandwiches) {\n        std::queue q(std::deque<int>(students.begin(), students.end()));\n        int index=0;\n        int cnt= 0;\n        while(!q.empty()){\n            int curr= q.front();\n            q.pop();\n            if(curr != sandwiches[index]) cnt++,q.push(curr);\n            else cnt= 0,index++;\n            if(cnt== q.size()) break;\n        }\n        return q.size();\n    }\n};\n```\n**Feel free to ask any question in the comment section.**\nI hope that you\'ve found the solution useful.\nIn that case, **please do upvote and encourage me** to on my quest to document all leetcode problems\uD83D\uDE03\nHappy Coding :)\n
['Queue', 'C', 'C++']