DEV Community


Discussion on: Project Euler #4 - Largest Palindrome Product

farazpatankar profile image
Faraz Patankar

Yes. Let's try reading it step by step:

  1. We first check if the product is a palindrome. Because if it isn't, we don't care about it.
  2. Then, we check if it is greater than our existing largest palindrome because our goal is to find the largest palindrome.
  3. If both those conditions are true, the product being a palindrome and it being larger than our existing largest palindrome, we set that as our largest palindrome.

Hope that helps, let me know if you still have questions!

Thread Thread
1258632 profile image

Thank you, Faraz, I didn't know it was possible to use several conditional operators in one single line of code