Implemented exercise 1.5 - String compression.