Skip to content

Commit e150b77

Browse files
authoredDec 16, 2021
Merge pull request #87 from MaximSmolskiy/improve_project_euler_problem_4
Improve Project Euler problem 4
2 parents 39d5f9c + d00e0a8 commit e150b77

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed
 

‎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)