The ice cream shop's orders for the day are in orders, one flavour per scoop. Write CountScoops(orders) to return a map of how many scoops of each flavour were ordered. No orders gives an empty map.
CountScoops([]string{"mint", "mango", "mint"})→{'mango': 1, 'mint': 2}CountScoops([]string{})→{}func CountScoops(orders []string) map[string]intpackage main
func CountScoops(orders []string) map[string]int {
count := map[string]int{}
// your code here: range over orders and add 1 for this flavour
return count
}
Run tries the examples. When they look right, Submit.