Largest palindrome product: Difference between revisions
Content added Content deleted
(→{{header|Wren}}: Removed another unnecessary check.) |
(→{{header|Go}}: Updated as per Wren.) |
||
Line 44: | Line 44: | ||
j := reverse(i) |
j := reverse(i) |
||
p := i*pow + j |
p := i*pow + j |
||
// we assume here the palindromes will end in 9 |
|||
if p%10 != 9 { |
|||
continue |
|||
} |
|||
// k can't be even nor end in 5 to produce a product ending in 9 |
// k can't be even nor end in 5 to produce a product ending in 9 |
||
for k := high; k > low; k -= 2 { |
for k := high; k > low; k -= 2 { |