1 parent c219db1 commit 53403bdCopy full SHA for 53403bd
1 file changed
internal/exercises/solutions/13_variadic/variadic.go
@@ -0,0 +1,10 @@
1
+package variadic
2
+
3
+// Sum returns the sum of any number of integers
4
+func Sum(nums ...int) int {
5
+ total := 0
6
+ for _, num := range nums {
7
+ total += num
8
+ }
9
+ return total
10
+}
0 commit comments