摘要:
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: " 阅读全文
摘要:
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 hist 阅读全文
摘要:
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have 阅读全文
摘要:
本来以为没必要用栈,代码如下: class Solution { public: int longestValidParentheses(string s) { int stack = 0; int length=0,max=0; for(int i=0;i<s.length();i++) { if 阅读全文