using System.Collections.Generic;
public static void Main()
var myArray = new int[] {1, 2, 3, 4, 2, 4, 6, 7, 8};
var newArray = post4e(myArray, whereFunction);
foreach(var e in newArray)
private static bool whereFunction(int value)
public static IEnumerable<T> post4e<T>(IEnumerable<T> set, Func<T, bool> pred)
throw new ArgumentNullException("set");
throw new ArgumentNullException("pred");
.Select((v, idx) => new { v, idx })
.OrderByDescending(x => x.idx)
return Enumerable.Empty<T>();
return set.Skip(search.idx + 1);