'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input string (not partial).The...
分类:
其他好文 时间:
2015-04-22 20:34:04
阅读次数:
122
题目:
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...
分类:
其他好文 时间:
2015-04-21 22:49:16
阅读次数:
168
题目:
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
提示:
Did you use extra space?
A straight forward solution using O(mn) space is probably a bad idea....
分类:
其他好文 时间:
2015-04-19 22:52:07
阅读次数:
166
'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input string (not partial).The...
分类:
其他好文 时间:
2015-04-17 00:58:49
阅读次数:
127
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
click to show follow up.
Follow up:
Did you use extra space?
A straight forward solution using O(m...
分类:
其他好文 时间:
2015-04-12 10:40:06
阅读次数:
107
Given a m x n matrix,
if an element is 0, set its entire row and column to 0. Do it in place.
题目没有什么难度,但是可以在空间复杂度上做一些处理:
开始写的算法比较简单,将行和列中为0的部分记录下来,然后再经过一个赋值操作:
class Solution {
public:
void s...
分类:
编程语言 时间:
2015-04-11 17:55:45
阅读次数:
188
problem:
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
click to show follow up.
Follow up:
Did you use extra space?
A straight forward ...
分类:
其他好文 时间:
2015-04-09 12:00:06
阅读次数:
138
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
in place,主要是感觉比较麻烦,其实就是利用第一行和第一列保存该行列是否需要变0,再用两个变量表示第一行和第一列是否需要变0
代码:
public class Solution {
publi...
分类:
其他好文 时间:
2015-04-06 15:43:04
阅读次数:
109
/*
在终端输入多行,找出有“ould”的行,并打印,如:love could you and I with fate conspireTo grasp this sorry scheme of things entire,
Would not we shatter it to bitd - and then.
则输出:
Au,love could you and I with fate cons...
分类:
编程语言 时间:
2015-04-05 21:59:55
阅读次数:
180
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
click to show follow up.
Follow up:
Did you use extra space?
A straight forward solution using O(m...
分类:
其他好文 时间:
2015-04-04 23:47:00
阅读次数:
163