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

Stats:

CreatedJun 29, 2018
PublishedJun 29, 2018
Warriors Trained10805
Total Skips243
Total Code Submissions18808
Total Times Completed5670
C# Completions599
Python Completions2677
PHP Completions303
Ruby Completions228
C Completions104
JavaScript Completions1799
Lua Completions62
Haskell Completions41
Total Stars170
% of votes with a positive feedback rating93% of 962
Total "Very Satisfied" Votes841
Total "Somewhat Satisfied" Votes106
Total "Not Satisfied" Votes15
Total Rank Assessments10
Average Assessed Rank
6 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Cgandhi1 Avatar
  • anter69 Avatar
  • siebenschlaefer Avatar
  • JohanWiltink Avatar
  • B1ts Avatar
  • Torkel Avatar
  • dcieslak Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • teoriachaosu Avatar
  • ejini战神 Avatar
  • FaradayLab Avatar
  • kvbc Avatar
Ad