String Compression – 443. LeetCode

The “String Compression” problem requires reducing the size of a character array by compressing consecutive repeating characters into a single character followed by their count. For example, the [“a”, “a”, “b”, “b”, “b”, “c”] should be compressed to [“a”, “2”, “b”, “3”, “c”]. The challenge is to perform this compression…

read more