![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode题解
zfyseu1
这个作者很懒,什么都没留下…
展开
-
Leetcode题目之"Trapping Rain Water"
题目来源:https://leetcode.com/problems/trapping-rain-water/题目描述:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to原创 2015-08-03 15:13:18 · 486 阅读 · 0 评论 -
generateParenthesis——leetcode
原文地址:http://www.cnblogs.com/codingmylife/archive/2012/09/09/2677428.htmlvoid unguarded_generate(vector &result, string curr, int m, int n) { if (m == 0 && n == 0) { result.p转载 2016-07-19 19:56:19 · 502 阅读 · 1 评论 -
Leetcode题解---Regular Expression Matching Java实现
leetcode regular expression matching题目链接:https://leetcode.com/problems/regular-expression-matching/#/description解题思路:(1)匹配串长度为1时,特殊处理 (2)匹配串长度大于1时,分为两种情况情况1:匹配串第二个字符为‘*’情况2:匹配串第二个字符不是‘*’原创 2017-06-28 13:40:56 · 253 阅读 · 0 评论 -
Leetcode题解---WildCard Matching Java实现
如果和Regular Expression Matching采用同样的思路,会超时,Java代码如下:public static boolean isMatch(String s,String p) { if(p.length()==0) return s.length()==0; if(s.length()==0) { for(int i=0;i<p.length(原创 2017-06-28 15:03:10 · 389 阅读 · 0 评论 -
leetcode restore ip address Java实现
原题目链接:https://leetcode.com/problems/restore-ip-addresses/description/java代码:class Solution { public List restoreIpAddresses(String s) { ArrayList ips=new ArrayList(); Str原创 2017-09-17 15:28:27 · 562 阅读 · 0 评论 -
leetcod addboldtag Java
题目:Given a string s and a list of strings dict, you need to add a closed pair of bold tag and to wrap the substrings in s that exist in dict. If two such substrings overlap, you need to wrap the原创 2017-09-17 16:22:19 · 449 阅读 · 0 评论