Triangle
来源:互联网 发布:淘宝支点运动是真的吗 编辑:程序博客网 时间:2024/05/01 17:00
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[ [2], [3,4], [6,5,7], [4,1,8,3]]
The minimum path sum from top to bottom is 11
(i.e., 2 + 3 + 5 + 1 = 11).
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.
dp:
2-dimension array, O(n^2) extra space
dp:
1-dimension array, O(n) extra space
row is equal to col, right?
0 0
- Triangle
- Triangle
- Triangle
- Triangle
- Triangle
- Triangle
- Triangle
- Triangle
- Triangle
- Triangle
- Triangle
- Triangle
- Triangle
- Triangle
- Triangle
- Triangle
- Triangle
- Triangle
- Parse教程三(利用Parse进行本地数据保存与使用)
- Timer与TimerTask的真正原理&使用介绍
- NSCalendar
- 统一管理程序异常
- Java Notes-13(Oberver, Sockets)
- Triangle
- 命中缺高人指点
- 大型网站核心的架构(6-2)高性能
- [2013]蟠桃记
- NSDate
- kmp理解
- Java笔试和面试题目
- 设计模式之观察者
- 转 编程: VC++学习方法及书籍