Skip to content

Commit d00e0a8

Browse files
committed
Improve Project Euler problem 4
1 parent 9244e32 commit d00e0a8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Diff for: project-euler/Problem4/solv.m

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
product = number1 * number2; % builds the new product
66

77
% make sure product is a palindrome number.
8-
if (isPalindromeNumber(product))
9-
if (product > maxPalindrome)
10-
maxPalindrome = product;
11-
endif
8+
if (product > maxPalindrome && isPalindromeNumber(product))
9+
maxPalindrome = product;
1210
endif
1311
endfor
1412
endfor

0 commit comments

Comments
 (0)