Skip to content

Commit

Permalink
Merge pull request #87 from MaximSmolskiy/improve_project_euler_probl…
Browse files Browse the repository at this point in the history
…em_4

Improve Project Euler problem 4
  • Loading branch information
cozek authored Dec 16, 2021
2 parents 39d5f9c + d00e0a8 commit e150b77
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions project-euler/Problem4/solv.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
product = number1 * number2; % builds the new product

% make sure product is a palindrome number.
if (isPalindromeNumber(product))
if (product > maxPalindrome)
maxPalindrome = product;
endif
if (product > maxPalindrome && isPalindromeNumber(product))
maxPalindrome = product;
endif
endfor
endfor
Expand Down

0 comments on commit e150b77

Please sign in to comment.