Refactor
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "s0020_valid_parentheses.hpp"
|
||||
|
||||
bool match(string s1, string s2) {
|
||||
bool S0020::match(string s1, string s2) {
|
||||
return s1 == "(" && s2 == ")" ||
|
||||
s1 == "[" && s2 == "]" ||
|
||||
s1 == "{" && s2 == "}";
|
||||
@@ -8,7 +8,7 @@ bool match(string s1, string s2) {
|
||||
|
||||
// 直接用栈
|
||||
|
||||
bool Solution::isValid(string s) {
|
||||
bool S0020::isValid(string s) {
|
||||
stack<string> stack;
|
||||
int len = s.length();
|
||||
for (int i{0}; i < len; i++) {
|
||||
|
||||
Reference in New Issue
Block a user