Refactor and remove sqlite and replace with MySQL
This commit is contained in:
16
internal/helpers/match.go
Normal file
16
internal/helpers/match.go
Normal file
@@ -0,0 +1,16 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user