Given a 1-d array candy crush, return the shortest array after removing all the continuous same numbers (the no of occurences of repeating number >= 3)
input: 1-d array [1, 3, 3, 3, 2, 2, 2, 3, 1]
return: [1, 1] (Explanation:- 133322231->133331->11).
133322231->122231->131 gives answer as [131] which is not the shortest.
Time complexity should be better than O(n^2)