Assuming one can have arrays with consecutive duplicate elements, I'm looking for a way to turn this array:
['A', 'B', 'C', 'C', 'D', 'D', 'F']
into this:
[['A', 'B', 'C'], ['C', 'D'], ['D','F']]
Please mind that for my particular case an array may not have more than 2 consecutive duplicate elements.