Filter filters elements from the input slice based on the given predicate function.
It returns a new slice containing only elements that satisfy the predicate.
func Reduce[T, U any](input []T, acc U, accfn func(T, U) U) U
Reduce applies an accumulator function to each element of the input slice,
carrying forward the accumulated result.
It returns the final accumulated value.