add functions and variables name

This commit is contained in:
2023-02-25 23:34:15 +00:00
parent 636101f1fa
commit 6ef6e051e6
23 changed files with 414 additions and 97 deletions

9
src/reduce.go Normal file
View File

@@ -0,0 +1,9 @@
package main
func reduce[T any](reducer func(x T, y T) T, arr []T) T {
result := arr[0]
for i := 1; i < len(arr); i++ {
result = reducer(arr[i], result)
}
return result
}