2013年11月25日

Regular Expression Matching

摘要: 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 string (not partial).The function prototype should be:bool isMatch(const char 阅读全文

posted @ 2013-11-25 17:04 waruzhi 阅读(165) 评论(0) 推荐(0) 编辑

Maximal Rectangle

摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.思路:该题可以看作Largest Rectangle in Histogram的变形,对于每行,求出一个height数组,然后求出可以得到的最大值。参考资料:http://www.cnblogs.com/lichen782/p/leetcode_maximal_rectangle.html代码: 1 int maxRectangleInHistog 阅读全文

posted @ 2013-11-25 12:34 waruzhi 阅读(222) 评论(0) 推荐(0) 编辑

导航