1700. Number of Students Unable to Eat Lunch

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 1700

class Solution:
    def countStudents(self, students: List[int], sandwiches: List[int]) -> int:
        cnt = Counter(students)
        for v in sandwiches:
            if cnt[v] == 0:
                return cnt[v ^ 1]
            cnt[v] -= 1
        return 0