最新 最热

LeetCode22- Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.

2019-07-01
1

leetcode 32 Longest Valid Parentheses

class Solution {public: int longestValidParentheses(string s) { int res = 0, start = 0; stack<int> m; for (int i = 0; i < s.size();...

2018-06-04
0

leetcode 20 Valid Parentheses

class Solution {public: bool isValid(string s) { stack<char> parentheses; for (int i = 0; i < s.size(); ++i) { if (s[i] == '(' ...

2018-06-04
0

leetcode 22 Generate Parentheses

class Solution {public: vector<string> generateParenthesis(int n) { set<string> t; if (n == 0) t.insert(""); else { vec...

2018-06-04
0

Leetcode 22 Generate Parentheses 搜索与DP的纠结

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:[ "((()...

2018-01-12
1