I\'m trying to find a LINQ expression to compare two list elements.
What i want to do is:
List _int = new List { 1, 2, 3, 3, 4,
List _int = new List { 1, 2, 3, 3, 4, 5 }; Enumerable.Range(0, _int.Count - 1) .Select(i => new {val = _int[i], val2 = _int[i + 1]}) .Where(check => check.val == check.val2) .Select(check => check.val);