(x, y, parenthesis)
| 31 | result = [] |
| 32 | |
| 33 | def _generateParenthesis(x, y, parenthesis): |
| 34 | if not x and not y: |
| 35 | result.append(parenthesis) |
| 36 | return |
| 37 | |
| 38 | if y > x: |
| 39 | _generateParenthesis(x, y-1, parenthesis=parenthesis+')') |
| 40 | |
| 41 | if x: |
| 42 | _generateParenthesis(x-1, y, parenthesis=parenthesis+'(') |
| 43 | |
| 44 | _generateParenthesis(n-1, n, '(') |
| 45 |
nothing calls this directly
no outgoing calls
no test coverage detected