18 lines
278 B
Go
18 lines
278 B
Go
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
|