From bbb27e4be5713b93c9d9d817837bd83f4367695c Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 13 Mar 2020 00:30:33 +0000 Subject: [PATCH] correction to foldint --- subjects/foldint.en.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/subjects/foldint.en.md b/subjects/foldint.en.md index 582668752..ee0557917 100644 --- a/subjects/foldint.en.md +++ b/subjects/foldint.en.md @@ -20,7 +20,7 @@ The function should have as parameters a function, `f func(int, int) int` a slic ### Expected function ```go -func FoldInt(f func(int, int) int, slice []int, acc int) { +func FoldInt(f func(int, int) int, arr []int, n int) { } ``` @@ -33,14 +33,14 @@ Here is a possible program to test your function: package main func main() { - table := []int{1, 2, 3} - ac := 93 - FoldInt(Add, table, ac) - FoldInt(Mul, table, ac) - FoldInt(Sub, table, ac) - fmt.Println() - - table = []int{0} + table := []int{1, 2, 3} + ac := 93 + FoldInt(Add, table, ac) + FoldInt(Mul, table, ac) + FoldInt(Sub, table, ac) + fmt.Println() + + table = []int{0} FoldInt(Add, table, ac) FoldInt(Mul, table, ac) FoldInt(Sub, table, ac)