private void generateParenthesises(List<String> list, String s, int left, int right) {
        if (left == right && right == 0) {
            list.add(s);
        }
        if (left < 0 || right < 0 || left > right) {
            return;
        }
        else if (left == right) {
            generateParenthesises(list, s + "(", left - 1, right);
        }
        else {
            generateParenthesises(list, s + "(", left - 1, right);
            generateParenthesises(list, s + ")", left, right - 1);
        }
    }