MCPcopy Create free account
hub / github.com/cp-algorithms/cp-algorithms / generate_all2

Function generate_all2

test/test_balanced_brackets.cpp:44–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44vector<string> generate_all2(int n) {
45 vector<string> all;
46 for (int i = 0; i <= n; i++) {
47 string s = string(i, '(') + string(i, ')');
48 s += string(n-i, '[') + string(n-i, ']');
49 find_all_permutation(s, all);
50 }
51 sort(all.begin(), all.end());
52 return all;
53}
54
55void test_all(int n) {
56 vector<string> all = generate_all(n);

Callers 1

test_all2Function · 0.85

Calls 1

find_all_permutationFunction · 0.85

Tested by

no test coverage detected