Skip to content

Instantly share code, notes, and snippets.

@montj2
Created April 28, 2014 15:12
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 montj2/11375040 to your computer and use it in GitHub Desktop.
Save montj2/11375040 to your computer and use it in GitHub Desktop.
The Fog Creek Dev Application Challenge @ http://www.fogcreek.com/Jobs/Dev/
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