Completed problem 1.5 String compression