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 8747fe1

Browse files
Merge pull request youngyangyang04#2785 from iYaovo/fix/0046-全排列
docs:补充0046Java代码的return语句
2 parents 8ddf0b5 + a45758e commit 8747fe1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎problems/0046.全排列.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ class Solution {
201201
public void backtrack(int[] nums, LinkedList<Integer> path) {
202202
if (path.size() == nums.length) {
203203
result.add(new ArrayList<>(path));
204+
return;
204205
}
205206
for (int i =0; i < nums.length; i++) {
206207
// 如果path中已有,则跳过
@@ -524,3 +525,4 @@ public class Solution
524525
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
525526
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
526527
</a>
528+

0 commit comments

Comments
(0)

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