import java.util.Stack;
class Solution {
public boolean solution(String s) {
Stack<Character> stack = new Stack<>();
char[] charArray = s.toCharArray();
if(charArray[0] == ')') return false;
for (char c : charArray) {
if (c == '(') stack.push(c);
if (stack.size() > 0 && c == ')') stack.pop();
}
return stack.size() == 0;
}
}