// Begin with an empty string s. For each group of consecutive repeating characters in chars: // If the group's length is 1, append the character to s. // Otherwise, append the character followed by ...
Input: chars = ["a","a","b","b","c","c","c"] Output: Return 6, and the first 6 characters of the input array should be: ["a","2","b","2","c","3"] Explanation: The ...