MCPcopy Create free account
hub / github.com/VanjaRo/LeetCode / backTrack

Function backTrack

tasks/22.go:16–27  ·  view source on GitHub ↗
(output *[]string, current string, opened, closed, max int)

Source from the content-addressed store, hash-verified

14}
15
16func backTrack(output *[]string, current string, opened, closed, max int) {
17 if len(current) == max {
18 *output = append(*output, current)
19 }
20 if opened > 0 {
21 backTrack(output, current+"(", opened-1, closed, max)
22
23 }
24 if closed > opened {
25 backTrack(output, current+")", opened, closed-1, max)
26 }
27}

Callers 1

generateParenthesisFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected