fork download
  1. class Numeric
  2. def palindrome?
  3. self.to_s == self.to_s.reverse
  4. end
  5. end
  6.  
  7. p (1..999).to_a.combination(2).map{|(x1, x2)| x1 * x2 }.select(&:palindrome?).max
  8. p Numeric.superclass
Success #stdin #stdout 0.88s 14560KB
stdin
Standard input is empty
stdout
906609
Object