re: Project Euler #4 - Largest Palindrome Product VIEW POST

re: A naive F# implementation: let reverse (s : string) = s |> Seq.toArray |> Array.rev |> System.String let palindrome n = let s = string...

This is another solution that I consider working in this particolar case (3 digits) but not actually correct (granted I could understand F# 😅). I explained it here:


This code generates the sequence of all palindromes which are products of 3 digit numbers and then selects the largest with Seq.max, so it does indeed produce the correct solution (just verify it on the Project Euler website).

You were right though about the Ruby version in your other comment. On a side note though: maybe don't go around telling people their code might be wrong if you can't actually understand the language it's written in?

I'm sorry if that seemed rude, that wasn't my intention at all. I did add "granted I could understand F#" in case I was wrong.

But no, I will keep on trying to understand what's going on in other people's code even out of my comfort zone, because I'll have the chance to learn something new 👌

If your intention really is to learn then you'd be better of asking questions (e.g. "I don't know F#, would you mind explaining how this selects the biggest palindrome?") instead of making statements that need a qualifier of potentially being wrong.

Being wrong is nothing to be ashamed of, as long as you're ready to stand corrected.

My mistake in this case is that I commented while it was very late 😴 Took note on the approach, though.

code of conduct - report abuse