Write Total(prices) to add up the prices in the slice and return it. An empty one gives 0.
Total([]int{3, 5, 2})→10Total([]int{})→0func Total(prices []int) intpackage main
func Total(prices []int) int {
sum := 0
// your code here: for with range, adding each price to sum
return sum
}
Run tries the examples. When they look right, Submit.