Whats wrong with my code? Anyone?

amazon
Tags: #<Tag:0x00007f2426a3a010>

#1

bool check(char s1, char s2)
{
if(s1==’(’ && s2==’)’ )
{
return true;
}
return false;
}

int Solution::solve(string A)
{
int n = A.size();
stackst;
for(int i=0;i<n;i++)
{
if(A[i] ==’(’ )
{
st.push(A[i]);
}
else if(A[i]==’)’)
{
if(st.empty())
{
return 0;
}
else if(!check(st.top(),A[i]))
{
return 0;
}
else
{
st.top(); //when it has matched with the input character.
}
}
}

if(st.empty())
{
    return 1;
}

return 0;

}