Challenge overview
Hello and welcome to the challenge!
Write the function which takes the string s
and the separator sep
, and next returns the string created by replacing each character in s
with a number of times that character occured in s
and separating the numbers with the string sep
.
Example
translate('abcc','-') -> '1-1-2-2'
You can solve this programming contest in C++, C#, Ruby, JavaScript, Python and many other languages. If you want, you can also take part in other Challenges. Below you can find some of them:
Have fun and good luck! :)