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
# Project Euler problem #8 | |
# Find the greatest product of five consecutive digits in the 1000-digit number. | |
# This solution sorts each series of 5 digits by larger to lower digits (ie 54321) and and finds | |
# the largest number, since that would mean the series with the most larger numbers, then find the | |
# product of those digits. This is much more efficient than the one below. | |
# -- Joseph Hsu | |
long_number = <<NUMBER | |
73167176531330624919225119674426574742355349194934 |
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
[color] | |
branch = auto | |
diff = auto | |
status = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold |
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
require 'rubygems' | |
require 'eventmachine' | |
require 'em-http' # gem install em-http-request | |
require 'yajl' # gem install yajl-ruby | |
class String | |
def bold | |
"\033[1m#{self}\033[0m" | |
end | |
end |
NewerOlder