Movatterモバイル変換


[0]ホーム

URL:


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

Commite82a361

Browse files
update 22
1 parent0e228de commite82a361

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ public List<String> generateParenthesis(int n) {
3333
if (n ==0) {
3434
returnresult;
3535
}
36-
helper(result,"",n,n);
36+
backtrack(result,"",n,n);
3737
returnresult;
3838
}
3939

40-
voidhelper(List<String>result,Stringpar,intleft,intright) {
40+
voidbacktrack(List<String>result,Stringpar,intleft,intright) {
4141
if (left >0) {
42-
helper(result,par +"(",left -1,right);
42+
backtrack(result,par +"(",left -1,right);
4343
}
4444
if (right >left) {
45-
helper(result,par +")",left,right -1);
45+
backtrack(result,par +")",left,right -1);
4646
}
4747
if (right ==0) {
4848
result.add(par);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp