The toughest solution!


#1

int Solution::solve(string A) {
stack st;
for(int i=0;i<A.length();i++){
if(!st.empty()&&A[i]==’)’&&st.top()==’(’)
st.pop();
else st.push(A[i]);
}
if(st.empty())
return 1;
else return 0;
}
:joy::joy::joy:


#2

wwwoooooooooww!!!
sir!!! .
maaal senior !!!


#3

Woooooooowwwwwwwwwwwwwwwwwwwwwww,
Thanks for the help. XD