["a","a","b","b","c","c","c"]
Return 6, and the first 6 characters of the input array should be: ["a","2","b","2","c","3"]
"aa" is replaced by "a2". "bb" is replaced by "b2". "ccc" is replaced by "c3".
Return 1, and the first 1 characters of the input array should be: ["a"]
["a","b","b","b","b","b","b","b","b","b","b","b","b"]
Return 4, and the first 4 characters of the input array should be: ["a","b","1","2"].
Since the character "a" does not repeat, it is not compressed. "bbbbbbbbbbbb" is replaced by "b12".
Notice each digit has it's own entry in the array.
All characters have an ASCII value in [35, 126].