1Then the Lord answered Job from the whirlwind:
31“Can you direct the movement of the stars—
binding the cluster of the Pleiades
or loosening the cords of Orion?
Job 38:1,31 NLT
View all posts by Greg Christian

Published

6 thoughts on “Project Euler – Problem # 11 – Solved with Java”

they asked product of four numbers not two numbers

So as we’re looking for efficient algorithms here:
You’re overusing the for loop.
Your computation runs through the array ~ 4n^2
That doesn’t change the O(n^2) I know, but there’s room for optimization :-)

they asked product of four numbers not two numbers

The code is fine, it’s the wordpress code window that fooled ya

Thanks for the comment!

So as we’re looking for efficient algorithms here:

You’re overusing the for loop.

Your computation runs through the array ~ 4n^2

That doesn’t change the O(n^2) I know, but there’s room for optimization :-)

Thanks for the comment!

Reblogged this on { stackPie Blog }.