Unable to solve with char fucntion

https://practice.geeksforgeeks.org/problems/run-length-encoding/1#
in this question function is made with char on place of string.
i am unablet to solve this, how to concat the chars in this question.