Say I have an array of strings like this:
$in_arr = ['a', 'a', 'b', 'b', 'a', 'b', 'b', 'a', 'a', 'b'];
I would like an efficient way to merge all a's into a single value but leave the b's untouched so the result will be:
['a', 'b', 'b', 'a', 'b', 'b', 'a', 'b']