function solution(s){
var stack = [];
var arr = [...s];
for (var i = 0; i < arr.length; i++) {
if (stack.length == 0 && arr[i] == ')') return false;
else if (arr[i] == '(') stack.push(1);
else if (arr[i] == ')') stack.pop();
}
return stack.length > 0 ? false : true;
}