7 kyu
Interview Question (easy)
599 of 5,670Cgandhi1
Description:
You receive the name of a city as a string, and you need to return a string that shows how many times each letter shows up in the string by using asterisks (*
).
For example:
"Chicago" --> "c:**,h:*,i:*,a:*,g:*,o:*"
As you can see, the letter c
is shown only once, but with 2 asterisks.
The return string should include only the letters (not the dashes, spaces, apostrophes, etc). There should be no spaces in the output, and the different letters are separated by a comma (,
) as seen in the example above.
Note that the return string must list the letters in order of their first appearance in the original string.
More examples:
"Bangkok" --> "b:*,a:*,n:*,g:*,k:**,o:*"
"Las Vegas" --> "l:*,a:**,s:**,v:*,e:*,g:*"
Have fun! ;)
Fundamentals
Strings
Similar Kata:
Stats:
Created | Jun 29, 2018 |
Published | Jun 29, 2018 |
Warriors Trained | 10805 |
Total Skips | 243 |
Total Code Submissions | 18808 |
Total Times Completed | 5670 |
C# Completions | 599 |
Python Completions | 2677 |
PHP Completions | 303 |
Ruby Completions | 228 |
C Completions | 104 |
JavaScript Completions | 1799 |
Lua Completions | 62 |
Haskell Completions | 41 |
Total Stars | 170 |
% of votes with a positive feedback rating | 93% of 962 |
Total "Very Satisfied" Votes | 841 |
Total "Somewhat Satisfied" Votes | 106 |
Total "Not Satisfied" Votes | 15 |
Total Rank Assessments | 10 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 7 kyu |