Problem 42936. Project Euler: Problem 11, Largest product in a grid
Solution Stats
Problem Comments
-
4 Comments
Since I can't tell from the test suite, do you wrap around the matrix when you are calculating the products? For example, when doing the products of four consecutive numbers in the up/down direction, do you do rows 1:4, 2:5, 3:6, 4:7...7:10 and stop there, or do you include the row combinations [8:10 1], [9:10 1:2] and [10 1:3]?
Just submitted my solution (slightly modified from the original Project Euler problem! :-), and the values do not wrap around in any direction.
I vaguely remember there was an earlier problem exactly the same as this one on Cody, and I solved that problem some time ago. But couldn't find the old problem....
All diagonals and reverse diagonals must be tested if you are wondering as I were once.
Solution Comments
-
1 Comment
I don't understand why my solution is wrong. When I manually check it, it works good.
Problem Recent Solvers61
Suggested Problems
-
5374 Solvers
-
144 Solvers
-
Project Euler: Problem 1, Multiples of 3 and 5
2329 Solvers
-
Find third Side of a right triangle given hypotenuse and a side. No * - or other functions allowed
163 Solvers
-
Find the index of n in magic(n)
188 Solvers
More from this Author2
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!