# 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.

- Base case:

`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:`

1 | Input: triangle = [[2],[3,4],[6,5,7],[4,1,8,3]] |

`Code:`

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

1 | /** |