6 kyu

Simple decrypt algo

1,069 of 1,835mkelty

Description:

You'll be given a string of random characters (numbers, letters, and symbols). To decode this string into the key we're searching for:

(1) count the number occurences of each ascii lowercase letter, and

(2) return an ordered string, 26 places long, corresponding to the number of occurences for each corresponding letter in the alphabet.

For example:

'$aaaa#bbb*cc^fff!z' gives '43200300000000000000000001'
   ^    ^   ^  ^  ^         ^^^  ^                   ^
  [4]  [3] [2][3][1]        abc  f                   z
  
'z$aaa#ccc%eee1234567890' gives '30303000000000000000000001'
 ^  ^   ^   ^                    ^ ^ ^                    ^
[1][3] [3] [3]                   a c e                    z

Remember, the string returned should always be 26 characters long, and only count lowercase letters.

Note: You can assume that each lowercase letter will appears a maximum of 9 times in the input string.

Strings
Fundamentals

More By Author:

Check out these other kata created by mkelty

Stats:

CreatedJan 1, 2017
PublishedJan 1, 2017
Warriors Trained2646
Total Skips51
Total Code Submissions4481
Total Times Completed1835
Python Completions1069
Haskell Completions71
C Completions144
Ruby Completions71
JavaScript Completions537
Scala Completions14
BF Completions6
Total Stars34
% of votes with a positive feedback rating94% of 341
Total "Very Satisfied" Votes308
Total "Somewhat Satisfied" Votes28
Total "Not Satisfied" Votes5
Total Rank Assessments11
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • mkelty Avatar
  • suic Avatar
  • damjan Avatar
  • Chrono79 Avatar
  • Voile Avatar
  • rowcased Avatar
  • nibble-4bits Avatar
  • user9644768 Avatar
  • jebreen Avatar
  • Just4FunCoder Avatar
  • KayleighWasTaken Avatar
  • saudiGuy Avatar
Ad