题目描述:
Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two endpoints of line i is at (i, ai) and (i...
分类:
其他好文 时间:
2014-12-25 11:24:50
阅读次数:
163
Problem StatementYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes ...
分类:
其他好文 时间:
2014-12-24 16:08:33
阅读次数:
137
题目:
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
Note: You can only move either down or r...
分类:
编程语言 时间:
2014-12-23 14:01:48
阅读次数:
218
Add Two NumbersYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes co...
分类:
其他好文 时间:
2014-12-23 13:40:36
阅读次数:
183
【题目】
Given two numbers represented as strings, return multiplication of the numbers as a string.
Note: The numbers can be arbitrarily large and are non-negative.
【解析】
题意:两个字符串表示的非负整数相乘,用字符串的...
分类:
其他好文 时间:
2014-12-23 12:32:31
阅读次数:
174
Minimum Path SumGiven a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers ...
分类:
其他好文 时间:
2014-12-22 21:11:52
阅读次数:
229
思路:如果时间复杂度要求是O(n 2 )的话,解法比较多也比较好理解。比如可以遍历,对于当前 i 位置上的立柱,计算出以这个i 立柱结尾的最大矩形,然后求出总的最大矩形。
Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, f...
分类:
编程语言 时间:
2014-12-18 22:18:58
阅读次数:
219
Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo...
分类:
其他好文 时间:
2014-12-17 20:47:20
阅读次数:
167
【题目】
Given a list, rotate the list to the right by k places, where k is non-negative.
For example:
Given 1->2->3->4->5->NULL and k = 2,
return 4->5->1->2->3->NULL.
【解析】
题意:把链表循环右移k个结点。
不是...
分类:
其他好文 时间:
2014-12-17 18:30:18
阅读次数:
148
Given n non-negative integers a1, a2, ...,
an, where each represents a point at coordinate (i,
ai). n vertical lines are drawn such that the two endpoints of line
i is at (i, ai) and (i, 0). Find ...
分类:
其他好文 时间:
2014-12-17 14:45:13
阅读次数:
141