What is the greatest product of k adjacent numbers in the same direction (up, down, left, right, or diagonally) in a n×n grid ?
Project Euler Problem 11
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....
I don't understand why my solution is wrong. When I manually check it, it works good.
letter yes yes & letter no no
Matrix with different incremental runs
Number of odd and even elements within matrix
Number of Even Elements in Fibonacci Sequence
Project Euler: Problem 18, Maximum path sum I
Project Euler: Problem 14, Longest Collatz sequence
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