String Compression problem

2 test cases are not working

@sulbh579 hey sulbh your code is not working for the large set of the input such as
aaaaaaaaaaaaaaagggxsxssyyyyyoooooooooolllllwwqwdeddddddddkjjjooooooooooooooooooo
your output is a15g3x2s3y5o29l5w3q1d9e1k1j3
but it should be
a15g3x1s1x1s2y5o10l5w2q1w1d1e1d8k1j3o20
so please do some work on it.

Please suggest corrections …I am not able to get it

@sulbh579 hey sulbh
follow this step to implement the code
steps
take a character array
run a loop from i=0 to strlen(char array)
inside the loop
take a count initialize with 1
then take a while loop inside the while loop (a[i]==a[i+1]&&i<len-1){
c++;
i++;
}
print the output a[i] and count