def run_encode(string)
  string
    .chars
    .chunk{|i| i}
    .map {|kind, array| [kind, array.length]}
end


def run_decode(char_counts)
  char_counts
    .map{|char, count| char * count}
    .join
end