7 kyu
Print count and numbers
126 of 750nakulgupta18
Description:
Given a string of integers, count how many times that integer repeats itself, then return a string showing the count and the integer.
Example: countMe('1123')
(count_me
in Ruby)
- Here 1 comes twice so
<count><integer>
will be"21"
- then 2 comes once so
<count><integer>
will be"12"
- then 3 comes once so
<count><integer>
will be"13"
hence output string will be "211213"
.
Similarly countMe('211213')
will return '1221121113'
(1 time 2, 2 times 1, 1 time 2, 1 time 1, 1 time 3)
Return ""
for empty, nil or non numeric strings
Fundamentals
Similar Kata:
Stats:
Created | Jul 6, 2015 |
Published | Jul 6, 2015 |
Warriors Trained | 1752 |
Total Skips | 61 |
Total Code Submissions | 3283 |
Total Times Completed | 750 |
Ruby Completions | 126 |
Python Completions | 306 |
JavaScript Completions | 279 |
C# Completions | 89 |
Total Stars | 27 |
% of votes with a positive feedback rating | 92% of 216 |
Total "Very Satisfied" Votes | 188 |
Total "Somewhat Satisfied" Votes | 22 |
Total "Not Satisfied" Votes | 6 |