Skip to content

Instantly share code, notes, and snippets.

@annelisebouyer
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save annelisebouyer/fdfe64e1aed779161076 to your computer and use it in GitHub Desktop.
Save annelisebouyer/fdfe64e1aed779161076 to your computer and use it in GitHub Desktop.
DOJO++: Kata#9 : Help Bill Murray with his passwords

#DOJO #9 : Help Bill Murray with his passwords

sorting characters

##Problem Description

Last night, all Bill Murray's accounts have been hacked! His password 'groundhogday' was the same for his Facebook account, Twitter account, Amazon account etc.

He decided to change all his passwords, and to use 21 differents high secure passwords for his 21 accounts. But he needs a way to store them and mainly, to remember them...

##What to do? He's asked us to write a program which generate a password based on a sentence. For that, the programm will take a block of text and return the letters it contains, sorted (step1)

For an even more secure password, he also want to have the ability to add numbers in his password. So then, the program will count the letter and replace 'aaaa' by '4a' ; 'bb' by '2b' etc (step2)

##What is the expected result? So, Given the text:

When not studying nuclear physics, Bambi likes to play beach volleyball.

our program would return:

Step1 : aaaaabbbbcccdeeeeeghhhiiiiklllllllmnnnnooopprsssstttuuvwyyyy

Step 2 : 5a4b3c1d5e1g3h4i1k7l1m4n3o2p1r4s3t2u1v1w4y

Then, Bill Murray has even all his 'passwords' online and nobody knows it! http://www.brainyquote.com/quotes/authors/b/bill_murray.html

###Hint The most interesting point here is to find the best way to sort characters, don't fool.