#include <leetcode.h>
◆ isValid()
bool leetcode::remove_invalid_parentheses::Solution::isValid |
( |
const string & |
str | ) |
|
|
static |
◆ removeInvalidParentheses()
vector< string > leetcode::remove_invalid_parentheses::Solution::removeInvalidParentheses |
( |
const string & |
s | ) |
|
|
static |
在文件 leetcode.cpp 第 8496 行定义.
8498 unordered_set<string> currSet;
8502 for(
auto &str: currSet) {
8504 ans.emplace_back(str);
8507 sort(ans.begin(), ans.end());
8510 unordered_set<string> nextSet;
8511 for(
auto &str: currSet) {
8512 for(
int i = 0; i < str.size(); i++) {
8513 if(i > 0 && str[i] == str[i - 1]) {
8516 if(str[i] ==
'(' || str[i] ==
')') {
8517 nextSet.insert(str.substr(0, i) + str.substr(i + 1, str.size()));
static bool isValid(const string &str)
引用了 isValid().
被这些函数引用 leetcode::remove_invalid_parentheses::TEST().
该类的文档由以下文件生成: