Implement regular expression matching with support for '.' and '*'.
'.' Matches any single character.
'*' Matches zero or more of the preceding element.
The matching should cover the entire input...
分类:
其他好文 时间:
2015-04-01 15:30:32
阅读次数:
153
题目:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 1 str...
分类:
其他好文 时间:
2015-04-01 10:49:18
阅读次数:
112
题目:
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity
should be O(log (m+n)).
思路:这道题比较直接的想法就是用Merge
Sort...
分类:
其他好文 时间:
2015-04-01 09:33:08
阅读次数:
143
题目:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first
two lists.
struct ListNode {
int val;
ListNode *next;
ListNo...
分类:
其他好文 时间:
2015-04-01 09:31:07
阅读次数:
131
LRU CacheDesign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get...
分类:
系统相关 时间:
2015-03-31 21:42:12
阅读次数:
167
题目:
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the end should remain...
分类:
其他好文 时间:
2015-03-31 18:02:00
阅读次数:
114
转载自:CoolShell 陈皓这篇文章来源于Quroa的一个问答《What are some time-saving tips that every Linux user should know?》—— Linux用户有哪些应该知道的提高效率的技巧。我觉得挺好的,总结得比较好,把其转过来,并加了一...
分类:
系统相关 时间:
2015-03-31 14:35:47
阅读次数:
234
Follow up for "Remove Duplicates":
What if duplicates are allowed at most twice?
For example,
Given sorted array A = [1,1,1,2,2,3],
Your function should return length = 5,
and A is now [1,1,...
分类:
其他好文 时间:
2015-03-31 10:55:22
阅读次数:
98
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:
其他好文 时间:
2015-03-31 09:17:23
阅读次数:
141
Problem Description
Tom is playing a game called Idiomatic Phrases Game. An idiom consists of several Chinese characters and has a certain meaning. This game will give Tom two idioms. He should build a list of idioms and the list starts and ends with the t...
分类:
其他好文 时间:
2015-03-31 09:08:57
阅读次数:
149