using System.Collections.Generic;
public static void Main()
var array = new [] { 1, 2, 4, 5, 6, 9 };
var filteredArray = array.Filter(x => x % 2 == 0);
public static class Extensions
public static IEnumerable<T> Filter<T>(this IEnumerable<T> source, Func<T, bool> predicate)
throw new NotImplementedException();