I have a solution that works and the entire test suite can run in 18 seconds on my laptop, but takes a little over 45 seconds to run on the server, so the server times out on the test cases.
I'm stumped trying to figure out how I can optimize this code any further.
I just re-ran the solution and this time it worked. I must have gotten a slow core the first time I ran it. ;-)
Reverse the vector
Project Euler: Problem 10, Sum of Primes
Get the length of a given vector
Duplicate each element of a vector.
Easy Sequences 5: Project Euler Problem 1 - Again!
Easy Sequences 15: Pythagorean Area with maximum Hypotenuse
Easy Sequences 62: Sum of Omega-3 Function
Easy Sequences 22: Sum of Proper Fractions
Easy Sequences 63: Base-63 Arithmetic Functions
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office