string compression using the counts of repeated characters