Is it possible to replace every sequential duplicate using linq? I tried using groups with no success. Basically, I need to get the following results:
string[] arr = new [] { "a", "a", "a", "b", "b", "b", "b", "c", "c", "c", "a", "a" }; // input
string[] res = new [] { "a", "R", "R", "b", "R", "R", "R", "c", "R", "R", "a", "R" }; // output