diff --git a/LeeCode_Problems/20.Valid_Parentheses.cpp b/LeeCode_Problems/20.Valid_Parentheses.cpp new file mode 100644 index 0000000..6483aa4 --- /dev/null +++ b/LeeCode_Problems/20.Valid_Parentheses.cpp @@ -0,0 +1,49 @@ + +// Time Complexity: O(n); +//Space Complexity: O(n) //auxiliary space +#include +using namespace std; + +class Solution { +public: + bool isValid(string s) { + stack stk; + int i=0; + for(int i=0;i