Problems > Down the Triangle > Editorial

Down the Triangle — Solution & Editorial

Back to the Problem

Fold bottom-up: dp over the last row, each level replacing dp[j] with row[j] + min(dp[j], dp[j+1]).

Complexity: O(N2)