Every dog walk this week is in minutes. Write LongWalks(minutes): a walk of 30 minutes or more is a long walk; return how many there were. An empty slice gives 0.
LongWalks([]int{20, 45, 30})→2LongWalks([]int{})→0func LongWalks(minutes []int) intpackage main
func LongWalks(minutes []int) int {
count := 0
for _, m := range minutes {
// your code here: 30 minutes or more? add 1 to count
}
return count
}
Run tries the examples. When they look right, Submit.