If LINQ is required:

```
Dim MyArray As String() = {"A", "A", "A", "B", "B", "C", "A", "A"}
Dim result As String() = MyArray.
Select(Function(v, i) New With {v, i}).
GroupBy(Function(p) p.v).
SelectMany(Function(g) g.Select(Function(p, i) New With {p.v, p.i, .d = p.i - i})).
GroupBy(Function(z) New With {Key z.v, Key z.d}).
Select(Function(g) New With {g.Key.v, .min = g.Min(Function(b) b.i), .max = g.Max(Function(b) b.i)}).
OrderBy(Function(t) t.min).
Select(Function(t) $"{t.min}-{t.max}").
ToArray
```

The result is an array of strings like "0-2", "3-4", etc.