Bloomberg interview question

compression of string