class Solution { boolean solution(String s) { char[] charArray = s.toCharArray(); int count = 0; for(int i = 0; i < charArray.length; i++){ if(count < 0) return false; if(charArray[i] == '(') count++; else{ count--; } } if(count == 0) return true; else return false; } }