Created
April 28, 2014 15:12
-
-
Save montj2/11375040 to your computer and use it in GitHub Desktop.
The Fog Creek Dev Application Challenge @ http://www.fogcreek.com/Jobs/Dev/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hash = 910897038977002 | |
letters = "acdegilmnoprstuw" | |
answer = "" | |
9.times do |x| #9 letter string loop | |
remainder = hash % 37 #get the remainder for lookup | |
answer = answer + letters[remainder] #add letter to the answer | |
hash = (hash - remainder) / 37 #now we're evenly divisible | |
end | |
puts answer.reverse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment