Largest palindrome product: Difference between revisions

Content added Content deleted
(Added Sidef)
m (→‎{{header|Sidef}}: slightly faster)
Line 1,161: Line 1,161:
var t = Num("#{k}#{Str(k).flip}")
var t = Num("#{k}#{Str(k).flip}")


t.divisors.grep{.len == n}.combinations(2, {|a,b|
t.divisors.each {|d|
if (a*b == t) {
if ((d.len == n) && ((t/d).len == n)) {
return (a, b)
return (d, t/d)
}
}
})
}
}
}
}
}