public int longestValidParentheses_naive(String s) {
    	if (s == null || s.length() == 0)
    		return 0;
        char[] arr = s.toCharArray();
        int len = 0;
        for (int i = 0; i < arr.length; i++) {
        	if (arr[i] == ')')
        		continue;
        	else {
        		int count = 1;
        		for (int j = i + 1; j < arr.length; j++) {
        			if (arr[j] == '(') {
        				count++;
        			} else {
        				count--;
        				if (count < 0)
        					break;
        				else if (count == 0) {
        					int newLen = j - i + 1;
        					if (newLen > len)
        						len = newLen;
        				}
        			}
        		}
        	}
        }
        return len;
    }