Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6940dc6

Browse files
22. Generate Parentheses
1 parent a522ea3 commit 6940dc6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎0001-0500/0022. Generate Parentheses.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Solution {
1919
func generateParenthesis(_ n: Int) -> [String] {
2020
var res: [String] = []
2121

22-
func backtrack(_ path: [String], _ target:Int) {
22+
func backtrack(_ path: [String]) {
2323
var path = path
2424
var count = 0
2525

@@ -36,12 +36,12 @@ class Solution {
3636
continue
3737
}
3838
path.append(c)
39-
backtrack(path, target -1)
39+
backtrack(path)
4040
path.remove(at: path.count - 1)
4141
}
4242
}
4343

44-
backtrack([], n *2)
44+
backtrack([])
4545
return res
4646
}
4747

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /