#
# 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
#
#
# @param students int整型一维数组
# @param sandwiches int整型一维数组
# @return int整型
#
class Solution:
def countStudents(self , students: List[int], sandwiches: List[int]) -> int:
# write code here
for c in sandwiches:#依次遍历所有三明治,当前三明治无论如何都不能被学生拿走时,结束分配
if c in students:
students.remove(c)
else:
break
return len(students)#输出没能拿到三明治的学生个数



京公网安备 11010502036488号