![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
可能是个积极废人
这个作者很懒,什么都没留下…
展开
-
[LeetCode]1021.RemoveOutermostParentheses(删除最外层的括号 )
有效括号字符串为空("")、"(" + A + ")"或A + B,其中A 和B都是有效的括号字符串,+代表字符串的连接。例如,"","()","(())()"和"(()(()))"都是有效的括号字符串。如果有效字符串S非空,且不存在将其拆分为S = A+B的方法,我们称其为原语(primitive),其中A 和B都是非空有效括号字符串。给出一个非空有效字符串S,考虑将其进行原语化分解,使得:S = P_1 + P_2 + ... + P_k,其中P_i是有效括号...原创 2020-05-11 17:48:26 · 236 阅读 · 0 评论 -
[LeetCode]155.MinStack(最小栈)
设计一个支持 push ,pop ,top 操作,并能在常数时间内检索到最小元素的栈。push(x) —— 将元素 x 推入栈中。pop()—— 删除栈顶的元素。top()—— 获取栈顶元素。getMin() —— 检索栈中的最小元素。示例:MinStack minStack = new MinStack();minStack.push(-2);minStack.push(0);minStack.push(-3);minStack.getMin(); --> 返回 -3...原创 2020-05-11 17:46:25 · 177 阅读 · 0 评论 -
[LeetCode]20. ValidParentheses(有效的括号)
题目:给定一个只包括 '(',')','{','}','[',']'的字符串,判断字符串是否有效。有效字符串需满足:左括号必须用相同类型的右括号闭合。左括号必须以正确的顺序闭合。注意空字符串可被认为是有效字符串。示例 1:输入: "()"输出: true示例2:输入: "()[]{}"输出: true示例3:输入: "(]"输出: false示例4:输入: "([)]"输出: false示例5:输入: "{[]}"输出: true...原创 2020-05-11 17:43:17 · 168 阅读 · 0 评论 -
[LeetCode]14. Longest Common Prefix(求最长前缀)
14. Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string "".Example 1:Input: ["flower",...原创 2018-11-20 11:58:52 · 183 阅读 · 0 评论