sum: range

This commit is contained in:
vinchent 2024-09-10 21:16:01 +02:00
parent 5775ea5e50
commit b427b8fbfb

View File

@ -3,8 +3,8 @@ package sum
func Sum(numbers [5]int) int { func Sum(numbers [5]int) int {
sum := 0 sum := 0
for i := 0; i < 5; i++ { for _, number := range numbers {
sum += numbers[i] sum += number
} }
return sum return sum
} }