Skip to content

Commit 886dd61

Browse files
committed
added python/1700-number-of-students-unable-to-eat-lunch.py
1 parent 96e744c commit 886dd61

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution:
2+
def countStudents(self, students: List[int], sandwiches: List[int]) -> int:
3+
num_of_students_back_in_line = 0
4+
while num_of_students_back_in_line != len(students):
5+
curr_student = students.pop(0)
6+
if curr_student == sandwiches[0]:
7+
sandwiches.pop(0)
8+
num_of_students_back_in_line = 0
9+
else:
10+
students.append(curr_student)
11+
num_of_students_back_in_line += 1
12+
return len(students)

0 commit comments

Comments
 (0)