# Leetcode 120 - Triangle

Note:

• Use recursion with memo
• Base case: i >= rows, return 0.
• Return type: sum of path, a num
• What to do: Find the min between two recursion calls.

Question:

Given a triangle array, return the minimum path sum from top to bottom.

For each step, you may move to an adjacent number of the row below. More formally, if you are on index i on the current row, you may move to either index i or index i + 1 on the next row.

Example:

Code:

O(n^2) because every num is iterated once. There are 1 + 2 + ... + n = O(n^2)