Files
website/helpers/match.go
2025-03-28 13:04:53 +00:00

17 lines
200 B
Go

package helpers
func CountMatches(a, b []int) int {
m := make(map[int]bool)
for _, n := range b {
m[n] = true
}
match := 0
for _, n := range a {
if m[n] {
match++
}
}
return match
}