Eliminating repetitions of subsequent items in a list
While aepot answer is a good answer and got my upvote it does only work for type int.  Which I know the question for an example uses int in their code but if wanting it to work for all data types will need to change the code a bit.
public static class EnumerableExtensions
{
    public static IEnumerable&lt;TSource&gt; FilterRepeatingElements&lt;TSource&gt;(this IEnumerable&lt;TSource&gt; source, IEqualityComparer&lt;TSource&gt; comparer)
    {
        using (var enumerator = source.GetEnumerator())
        {
            if (enumerator.MoveNext())
            {
                var item = enumerator.Current;
                yield return item;

                while (enumerator.MoveNext())
                {
                    if (!comparer.Equals(item, enumerator.Current))
                    {
                        item = enumerator.Current;
                        yield return item;
                    }
                }
            }
        }
    }

    public static IEnumerable&lt;TSource&gt; FilterRepeatingElements&lt;TSource&gt;(this IEnumerable&lt;TSource&gt; source)
    {
        return FilterRepeatingElements(source, EqualityComparer&lt;TSource&gt;.Default);
    }
}

This would work for any type and takes the same parameters as linq Distinct does since we are doing a &quot;kind of&quot; distinct.
var data = new int[] { 1, 12, 3, 3, 3, 8, 5, 5 };
var postData = data.FilterRepeatingElements().ToArray();

var items = new string[] { &quot;A&quot;, &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;C&quot;, &quot;D&quot;, &quot;D&quot; };
var postItems = items.FilterRepeatingElements().ToArray();