Ruby 1.8.6
I have an array containing numerical values. I want to reduce it such that sequences of the same value are reduced to a single instance of that value.
If the numbers are all single digits 0-9: a.join.squeeze('0-9').each_char.to_a should work.
a.join.squeeze('0-9').each_char.to_a