Cody

Problem 42938. Project Euler: Problem 18, Maximum path sum I

Solution 3016279

Submitted on 1 Oct 2020 at 13:53
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
x = [3 0 0 0 7 4 0 0 2 4 6 0 8 5 9 3]; assert(isequal(maxPathSum(x),23))

s = 25

Assertion failed.

2   Fail
assert(isequal(maxPathSum(tril(magic(10))),891))

s = 932

Assertion failed.

3   Fail
assert(isequal(maxPathSum(tril(magic(100)^2)),251716502500))

s = 2.5191e+11

Assertion failed.

4   Fail
assert(isequal(maxPathSum(tril(mod(magic(1000),997))),741570))

s = 912975

Assertion failed.

5   Fail
assert(isequal(maxPathSum(tril(gallery('integerdata',1e4,5e3,4))),37455089))

s = 49918800

Assertion failed.

Suggested Problems

More from this Author2

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!