public void generateHelper(List<String> result, String s, int left, int right) {
        if (left > right) {
            return;
        }

        if (left == 0 && right == 0) {
            result.add(s);
            return;
        }

        if (left > 0) {
            generateHelper(result, s + "(", left - 1, right);
        }

        if (right > 0) {
            generateHelper(result, s + ")", left, right - 1);
        }
    }