I'd like to get the index of elements that stand alone. It is possible that the elements themselves appear more often in the list (one after the other or mixed). The indication for a single element is that the predecessor and successor are not equal to the current element. Is there an elegant way to do this?
Example:
1. A
2. A
3. A
4. B
5. B
6. A
7. B
8. B
9. C
10. B
Result:
6,9,10