← 返回 amazon 的题目列表String Compression
类型:online_judge
Given an array of characters chars, compress it in-place to a list of characters and return the new length. The compression should replace sequences of repeated characters by the character followed by its frequency. You must perform all operations within the original array.
Example
Input
['a', 'a', 'b', 'b', 'c', 'c', 'c']