From: brabuhr@... Date: 2008-09-06T00:07:52+09:00 Subject: Re: Need a 40 LOC (ignoring comments) to be shorter -- suggestions wanted On Fri, Sep 5, 2008 at 2:26 AM, Robert Dober wrote: > I believe it can easily be seen that a number of form xy or abc where > xy and abc are not ordered in ascending order > cannot yield a solution hence: Building on that observation: #!/usr/bin/env ruby digits = [3, 4, 5, 6, 7] digits.sort! multiplier = "#{digits.shift}" multiplicand = "#{digits.shift}" multiplier << "#{digits.shift}" multiplicand << "#{digits.shift}" multiplicand << "#{digits.shift}" product = multiplicand.to_i * multiplier.to_i puts "#{multiplicand} * #{multiplier} = #{product}" # => 467 * 35 = 16345