Number of Students Unable to Eat Lunch LeetCode solution in Python

1
class Solution:
2
def countStudents(self, students: List[int], sandwiches: List[int]) -> int:
3
count = 0
4
while len(students) > count:
5
if students[0] == sandwiches[0]:
6
sandwiches.pop(0)
7
count = 0
8
else:
9
students.append(students[0])
10
count += 1
11

12
students.pop(0)
13
return len(students)
14

15

16
# Upvote will be encouraging.

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0