Najot ta'lim o'quvchisidan
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def countStudents(self, students: list[int], sandwiches: list[int]) -> int:\n        count = 0\n        while len(students) > count:\n            if students[0] == sandwiches[0]:\n                students.pop(0)\n                sandwiches.pop(0)\n                count = 0\n            else:\n                popped = students.pop(0)\n                students.append(popped)\n                count+=1\n        return len(students)\n```
['Python3']