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],
...
分类:
编程语言 时间:
2015-01-19 09:18:45
阅读次数:
286
Given an index k, return the kth row of the Pascal's triangle.
For example, given k = 3,
Return [1,3,3,1].
Note:
Could you optimize your algorithm to use only O(k) extra space?
这题和前面一题的区别...
分类:
编程语言 时间:
2015-01-19 09:17:31
阅读次数:
185
题目:Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use onl...
分类:
编程语言 时间:
2015-01-18 22:30:51
阅读次数:
291
题目:GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4...
分类:
编程语言 时间:
2015-01-16 23:45:10
阅读次数:
2605
The Triangle时间限制:1000 ms | 内存限制:65535 KB 难度:4描述73 88 1 02 7 4 44 5 2 6 5(Figure 1)Figure 1 shows a number triangle. Write a program that calculates th...
分类:
其他好文 时间:
2015-01-16 20:40:07
阅读次数:
141
Consider the number triangle shown below. Write a program that calculates the highest sum of numbers that can be passed on a route that starts at the top and ends somewhere on the base. Each step can...
分类:
其他好文 时间:
2015-01-16 10:05:03
阅读次数:
153
1510 - Neon SignJungHeum recently opened a restaurant called ‘Triangle’ and has ordered the following neon sign for hisrestaurant. The neon sign has N...
分类:
其他好文 时间:
2015-01-15 23:41:38
阅读次数:
251
在这之前,toString()所做的仅仅是返回this.name的内容而已,现在新增了额外的任务,检查对象中是否存在this.constructor.uber属性。
如果存在,就先调用该属性的toString方法。
this.constructor.uber指向当前对象父级原型的引用。
因而,当调用Triangle实体的toString方法时,其原型链上所有的toString都会被调用。...
分类:
其他好文 时间:
2015-01-15 10:59:10
阅读次数:
184
Given numRows, generate the first numRows of Pascal's triangle.
For example, given numRows = 5,
Return
[
[1],
[1,1],
[1,2,1],
[1,3,3,1],
[1,4,6,4,1]
]
class Solution {
public:
...
分类:
其他好文 时间:
2015-01-14 23:00:41
阅读次数:
339
Given an index k, return the kth row of the Pascal's triangle.
For example, given k = 3,
Return [1,3,3,1].
Note:
Could you optimize your algorithm to use only O(k) extra space?
class Solution...
分类:
其他好文 时间:
2015-01-14 22:57:33
阅读次数:
162