leetcode
so-as
非常努力才能看起来毫不费力!
展开
-
32. Longest Valid Parentheses
题目: Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.For “(()”, the longest valid parentheses substring is “()”, whic原创 2016-06-07 20:28:27 · 145 阅读 · 0 评论 -
84. Largest Rectangle in Histogram
题目: Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of largest rectangle in the histogram. Above is a histogram where width of ea原创 2016-06-07 22:19:18 · 201 阅读 · 0 评论 -
150. Evaluate Reverse Polish Notation
题目:Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1", "+", "原创 2016-06-08 10:58:23 · 237 阅读 · 0 评论 -
Valid Anagram (java)
题目: Given two strings s and t, write a function to determine if t is an anagram of s.For example, s = “anagram”, t = “nagaram”, return true. s = “rat”, t = “car”, return false.Note: You may assume原创 2016-06-02 20:03:30 · 353 阅读 · 0 评论 -
Count and Say (java)
题目: The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, …1 is read off as “one 1” or 11. 11 is read off as “two 1s” or 21. 21 is read off as “one 2原创 2016-06-02 15:44:02 · 191 阅读 · 0 评论 -
71. Simplify Path
Given an absolute path for a file (Unix-style), simplify it.For example, path = “/home/”, => “/home” path = “/a/./b/../../c/”, => “/c”Corner Cases: Did you consider the case where path = “/../”? In原创 2016-06-03 17:04:09 · 213 阅读 · 0 评论 -
58. Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the string.If the last word does not exist, return 0.Note: A word is defined as原创 2016-06-03 18:33:47 · 196 阅读 · 0 评论 -
20. Valid Parentheses
Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.The brackets must close in the correct order, “()” and “()[]{}” are all valid but “原创 2016-06-03 20:38:34 · 174 阅读 · 0 评论