From d6120776a59696317c3bc5c021cdb49da062cacc Mon Sep 17 00:00:00 2001 From: Manisha Kundnani <90680330+Manishak798@users.noreply.github.com> Date: Tue, 19 Nov 2024 12:33:36 +0530 Subject: [PATCH] Create validParentheses.cpp --- Arrays/validParentheses.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Arrays/validParentheses.cpp diff --git a/Arrays/validParentheses.cpp b/Arrays/validParentheses.cpp new file mode 100644 index 0000000..b393212 --- /dev/null +++ b/Arrays/validParentheses.cpp @@ -0,0 +1,25 @@ +class Solution { +public: + bool isValid(string s) { + if(s.size() == 1){ + return false; + } + stack st; + for(int i=0; i