For problem statement at 0-999/200-299/200-209/207/problemD10.txt this is a correct solution, but verifier at 0-999/200-299/200-209/207/verifierD10.go ends with failed to build reference: exit status 1
package 0-999/200-299/200-209/207/207D10.go is not in std (/usr/local/go/src/0-999/200-299/200-209/207/207D10.go)
exit status 1 can you fix the verifier? ```go
package main
import (
"bufio"
"fmt"
"os"
"regexp"
"strings"
)
var wordRe = regexp.MustCompile(`[a-z]+`)
func main() {
scanner := bufio.NewScanner(os.Stdin)
scanner.Scan() // skip document identifier
nameLine := ""
if scanner.Scan() {
nameLine = scanner.Text()
}
var sb strings.Builder
sb.WriteString(nameLine)
sb.WriteString(" ")
for scanner.Scan() {
sb.WriteString(scanner.Text())
sb.WriteString(" ")
}
content := strings.ToLower(sb.String())
words := wordRe.FindAllString(content, -1)
wordCount := make(map[string]int)
for _, w := range words {
wordCount[w]++
}
class1 := []string{
"government", "president", "election", "political", "law",
"court", "justice", "vote", "democracy", "congress",
"senate", "parliament", "policy", "minister", "campaign",
"candidate", "federal", "rights", "freedom", "war",
"peace", "treaty", "diplomatic", "republic", "democrat",
"republican",
}
class2 := []string{
"sport", "game", "team", "player", "league", "match",
"goal", "score", "win", "championship", "tournament",
"coach", "football", "basketball", "soccer", "tennis",
"baseball", "hockey", "race", "athlete", "olympic",
"medal", "defeat", "victory", "cup",
}
class3 := []string{
"trade", "market", "export", "import", "economic",
"economy", "stock", "price", "business", "commerce",
"tariff", "investment", "revenue", "profit", "goods",
"currency", "exchange", "trading", "supply", "demand",
"bank", "finance", "fiscal", "budget", "tax",
}
c1 := sumCounts(wordCount, class1)
c2 := sumCounts(wordCount, class2)
c3 := sumCounts(wordCount, class3)
if c1 > c2 && c1 > c3 {
fmt.Println(1)
} else if c2 > c1 && c2 > c3 {
fmt.Println(2)
} else if c3 > c1 && c3 > c2 {
fmt.Println(3)
} else {
if c3 >= c2 && c3 >= c1 {
fmt.Println(3)
} else if c2 >= c1 {
fmt.Println(2)
} else {
fmt.Println(1)
}
}
}
func sumCounts(wc map[string]int, words []string) int {
sum := 0
for _, w := range words {
sum += wc[w]
}
return sum
}
```