Number of Students Unable to Eat Lunch LeetCode solution in Python
1class Solution:2def countStudents(self, students: List[int], sandwiches: List[int]) -> int:3count = 04while len(students) > count:5if students[0] == sandwiches[0]:6sandwiches.pop(0)7count = 08else:9students.append(students[0])10count += 11112students.pop(0)13return len(students)141516# Upvote will be encouraging.