Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 74af51d

Browse files
update 22
1 parent e82a361 commit 74af51d

File tree

1 file changed

+4
-4
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+4
-4
lines changed

src/main/java/com/fishercoder/solutions/_22.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ public List<String> generateParenthesis(int n) {
3737
return result;
3838
}
3939

40-
void backtrack(List<String> result, String par, int left, int right) {
40+
void backtrack(List<String> result, String parenthesis, int left, int right) {
4141
if (left > 0) {
42-
backtrack(result, par + "(", left - 1, right);
42+
backtrack(result, parenthesis + "(", left - 1, right);
4343
}
4444
if (right > left) {
45-
backtrack(result, par + ")", left, right - 1);
45+
backtrack(result, parenthesis + ")", left, right - 1);
4646
}
4747
if (right == 0) {
48-
result.add(par);
48+
result.add(parenthesis);
4949
}
5050
}
5151
}

0 commit comments

Comments
 (0)