public String read(String s) {
        StringBuilder sb = new StringBuilder();
        int count = 1;
        int i = 1;
        char c = s.charAt(0);
        while (i < s.length()) {
            if (s.charAt(i) == c) {
                count++;
                i++;
            } else {
                sb.append(Integer.toString(count) + c);
                c = s.charAt(i);
                count = 1;
                i++;
            }
        }
        sb.append(Integer.toString(count) + c);

        return sb.toString();
    }