Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i...
分类:
其他好文 时间:
2014-11-17 06:53:34
阅读次数:
138
看到这个题目的时候,首先不认识 Determine这个单词,英文不好没办法,查了下是确认的意思,然后不懂 palindrome这个单词, 查了下是回文的意思。
问题是 回文是个什么东西,官方解释: A palindrome is
a word, phrase, number,
or other sequence of characters which
reads the same b...
分类:
其他好文 时间:
2014-11-17 01:45:30
阅读次数:
220
Word BreakGiven a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary words....
分类:
其他好文 时间:
2014-11-16 21:31:07
阅读次数:
173
more命令,功能类似 cat ,cat命令是整个文件的内容从上到下显示在屏幕上。 more会以一页一页的显示方便使用者逐页阅读,而最基本的指令就是按空白键(space)就往下一页显示,按 b 键就会往回(back)一页显示,而且还有搜寻字串的功能 。more命令从前向后读取文件,因此在启动时就加载整个文件。...
分类:
系统相关 时间:
2014-11-16 20:09:09
阅读次数:
227
Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?本来不...
分类:
其他好文 时间:
2014-11-16 17:10:02
阅读次数:
276
color space reduction divide the color space current value with a new input value to end up with fewer colors. For instance every value between zero a...
分类:
其他好文 时间:
2014-11-16 17:08:55
阅读次数:
169
Sort a linked list inO(nlogn) time using constant space complexity.分析:merge sort。class Solution {public: ListNode *sortList(ListNode *head) { ...
分类:
其他好文 时间:
2014-11-16 15:51:43
阅读次数:
210
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for...
分类:
其他好文 时间:
2014-11-16 08:11:04
阅读次数:
178
Similar with version I, but analysis is different. With the possibility of duplication, only ">" indicate a definite case of next search space.class S...
分类:
其他好文 时间:
2014-11-15 16:56:14
阅读次数:
201
There's usually a common strategy for "find *" problems - binary search: half the space can be dropped by some rules.And take care of corner cases.cla...
分类:
其他好文 时间:
2014-11-15 16:53:56
阅读次数:
171