O(1) space solution without stack


#1

Here stack is basically used as a counter.

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

}