diff --git a/task1/main.go b/task1/main.go index af037a4..863f491 100644 --- a/task1/main.go +++ b/task1/main.go @@ -1,6 +1,13 @@ package main -// Specify Filter function here +func Filter(array []int, predicate func(int, int) bool) (result []int) { + for index, element := range array { + if predicate(element, index) { + result = append(result, element) + } + } + return result +} func main() {