// Package q1700 implements a solution for https://leetcode.com/problems/number-of-students-unable-to-eat-lunch/ package q1700 func countStudents(students []int, sandwiches []int) int { wants := [2]int{} for _, w := range students { wants[w]++ } for _, s := range sandwiches { if wants[s] == 0 { return wants[0] + wants[1] } wants[s]-- } return 0 } var _ = countStudents