C++ || beats 100% || using queue
\nclass Solution {\npublic:\n    int countStudents(vector<int>& students, vector<int>& sandwiches) {\n        int count=0,i=0;\n        queue<int>q;\n        fo
```\nclass Solution {\npublic:\n    int countStudents(vector<int>& students, vector<int>& sandwiches) {\n        int count=0,i=0;\n        queue<int>q;\n        for(auto x:students)\n            q.push(x);\n        while(count<q.size() && i<sandwiches.size()){\n            if(sandwiches[i]==q.front()){\n                q.pop();\n                i++,count=0;\n            }else{\n                q.push(q.front());\n                q.pop();\n                count++;\n            }\n        }\n        return q.size();\n    }\n};\n```\n\n![image](https://assets.leetcode.com/users/images/3c41d116-139e-4f67-9129-439aa29b8720_1662615312.7970066.png)\n
['Queue', 'C', 'C++']