scores has the whole class's scores (at least one student, no two the same). Write TopAndPassed(scores) to return the top student's name and how many passed (60 or more) at once. A map's order can change every time, so don't rely on it.
TopAndPassed(map[string]int{"Ann": 72, "Bob": 95, "Cat": 58})→('Bob', 2)TopAndPassed(map[string]int{"Dan": 40})→('Dan', 0)func TopAndPassed(scores map[string]int) (string, int)package main
func TopAndPassed(scores map[string]int) (string, int) {
best, passed := "", 0
for name, s := range scores {
// your code here: higher? replace best; a pass adds 1 to passed
}
return best, passed
}
Run tries the examples. When they look right, Submit.