#Skip to menu

Maximum path sum I

First read the problem description.

This problem is very similar to Problem 15. We build a DAG and then find the longest path taking in consideration the weight of each node. This algorithm solves Problem 67 too.

1074
7273

Source code of the solution(s):