This repository contains algorithms written in MATLAB/Octave. Developing algorithms in the MATLAB environment empowers you to explore and refine ideas, and enables you test and verify your algorithm.
Project Euler problems solutions-programs shoud work not much more than one minute ("one-minute rule"). But current implementation works more than ten minutes.
It can be sped up if check whether product is palindrome only for products which are greater than current maxPalindrome value and thus can update it.
Before:
>> tic;solv;toc;
The greates palindrome number is 906609
Elapsed time is 635.412 seconds.
After:
>> tic;solv;toc;
The greates palindrome number is 906609
Elapsed time is 8.5047 seconds.
Project Euler problems solutions-programs shoud work not much more than one minute ("one-minute rule"). But current implementation works more than ten minutes.
It can be sped up if check whether
product
is palindrome only forproduct
s which are greater than currentmaxPalindrome
value and thus can update it.Before:
After: