Solution: String Compression
Explore how to implement run-length encoding to compress a character array in place by using two pointers. Understand how to track groups of repeating characters, overwrite the input array directly, and return the compressed length with constant extra space.
We'll cover the following...
We'll cover the following...
Statement
Given an array of characters, chars, compress it in place according to the following rules:
Start with an empty string
s.For each group of consecutive repeating characters in
chars:If the group length is
...