Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
Note:
Bonus point if you are able to do this using only O(n) extra space, where n is the total number of rows in the triangle.
給一三角形,找到一條從上到下最小總和的路徑,回傳總和值。
注意:
額外的挑戰:你只能使用O(n)的空間複雜度,n代表三角形的高度。
LeetCode
C++