Skip to content

Instantly share code, notes, and snippets.

@zumbalogy
Last active January 1, 2016 22:59
Show Gist options
  • Save zumbalogy/8213846 to your computer and use it in GitHub Desktop.
Save zumbalogy/8213846 to your computer and use it in GitHub Desktop.
require './names'
total = 0
@names.sort.each_with_index do |name, index|
name_score = 0
a = name.upcase
a.each_byte do |byte|
name_score += (byte-64)
end
total += (name_score * index+1)
end
p total
# 871198282 right
# 870878909 mine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment