#include <iostream>
#include <stack>
#include <string>
using namespace std;
bool isValid(string s) {
// TODO: use a stack to check valid parentheses
return false;
}
int main() {
cout << boolalpha;
cout << isValid("()") << endl; // true
cout << isValid("()[]{}") << endl; // true
cout << isValid("(]") << endl; // false
return 0;
}
Click Run to execute, or Submit to grade (all languages).