Golang project 38
Hi, please help me with the project 38 (match results). I have tried to fulfill the task with different code variants, but it seems i miss something. It says that i should append the array with the last result and then calculate the sum of its elements. I have tried to add the last result, but then the output is 20 (it requires 22) as it is a draw, so I've decided that maybe it should be a win, so I appended the first element and the output is correct is 22. Still it says that only the 1st case is correct and other doesn't display requires values package main import "fmt" func main() { results := []string{"w", "l", "w", "d", "w", "l", "l", "l", "d", "d", "w", "l", "w", "d"} var a int //results = append (results, results[(len(results)-1)]) results = append (results, results[0]) for _, v := range results { switch { case v == "w": a += 3 case v == "l": a += 0 case v == "d": a += 1 } } fmt.Println(a) }