No need for stack


#1
int Solution::solve(string A) {
    int open=0;
    for(int i=0;i<A.length();i++){
        if(A[i]=='(') open++;
        else if(open>0 )open--;
        else return 0;
    }
    if(open==0) return 1;
    return 0;
}