int maxDepth(string s) {
// Write your code here.
int count=0;
int m=0;
for(int i=0;i<s.length();i++)
{
if(s[i]=='(')
{
count++;
m=max(m,count);
}
if(s[i]==')')
{// checking valid parenthesis
count--;
}
}
return m-count; //max opened- not valid parenthesis
}