Book: Cracking the Coding Interview
Question: 1.5 (page 73)
Implement a method to perform basic string compression using the counts of repeated characters. For example, the string "aabcccccaaa" would become "a2b1c5a3". If the "compressed" string would not become the smaller than the original string, your method should return the original string.
Solution: Complexity - O(n)
No comments:
Post a Comment