<commit_before>#include <iostream>
using namespace std;

int arr[50]={0};

void append(int arr[],int pos,int num)
{
arr[pos] = num;
}

void compress(string s )
{
int i=-1,j,cnt=0,ind=-1;
char cur=s[0];
while(i!=s.length()) {
i++;
while(s[i]==cur)
{
cnt++;
s.erase(i,1);
if(s[i] != s[i+1]) break;
}
append(arr,++ind,cnt);
cur=s[i];
cnt=0;
}

for(int i=0;i<s.length();i++)

{   if(arr[i]==0)
    continue;
    cout<<arr[i]<<s[i];
}

}

int main()
{
    string s = "ttttttthhhhhiiiiisssaaaavvvvveeerrryyylooongwwwword";
    compress(s);
    return 0;
}
<commit_msg>Update run_length_encoding.cpp<commit_after>#include <iostream>
using namespace std;

void run_encode(string message)
{   int i=0,j,cnt=0;
    while(i!=message.length())
    {

        j=i;
        while(message[i]==message[j])
        {cnt++;j++;}
        if (cnt==1) {cout<<message[i];}else
        cout<<cnt<<message[i];
        i=j;
        cnt=0;
    }
}

void run_decode()
{
    // to implement
}

int main()
{
    // example string 1
    string s = "WWWWWWWVWWWBBBBBBBBBCCCCDDD";
    // example string 2
    string s2 = "WVBCD";
    
    run_encode(s);
    cout<<endl;
    run_encode(s2);

    return 0;
}

{'fraction_non_alphanumeric': 0.1974468085106383, 'fraction_numerical': 0.01872340425531915, 'mean_word_length': 3.2454873646209386, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 3, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1173012', 'n_tokens_mistral': 517, 'n_tokens_neox': 507, 'n_words': 89}