#include <iostream>
#include <vector>
#include <string>
using namespace std;

vector<string> compress(vector<char>& chars) {
    int n = chars.size();
    vector<string> result;

    for (int i = 0; i < n; ) {
        char currentChar = chars[i];
        int count = 0;

        // Count repetitions
        int j = i;
        while (j < n && chars[j] == currentChar) {
            count++;
            j++;
        }

        // Build entry
        if (count == 1) {
            result.push_back(string(1, currentChar));
        } else {
            result.push_back(currentChar + to_string(count));
        }

        i = j;
    }

    return result;
}
int main() {
    vector<char> input = {'a', 'a', 'b', 'c', 'c', 'c'};

    vector<string> compressed = compress(input);
    cout << "Compressed vector of strings: ";
    for (const string& s : compressed) {
        cout << s << " ";
    }
    cout << endl;

    return 0;
}
