DEV Community

loading...

Discussion on: Project Euler #4 - Largest Palindrome Product

Collapse
maxart2501 profile image
Massimo Artizzu

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: dev.to/maxart2501/comment/b9me

Collapse
citizen428 profile image
Michael Kohl

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?

Thread Thread
maxart2501 profile image
Massimo Artizzu

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 👌

Thread Thread
citizen428 profile image
Michael Kohl

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.

Thread Thread
maxart2501 profile image
Massimo Artizzu

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.