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

[pull] master from youngyangyang04:master #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
pull merged 6 commits into AlgorithmAndLeetCode:master from youngyangyang04:master
Jun 18, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
纠正 0047.全排列II JS、TS 版本代码
JS 和 TS 里面 数组深拷贝一般采用 ES6 扩展运算符 ... ,或者 Array.from() 方法,而不会采用实例方法 slice. slice方法用于数组分割等操作,请注意代码书写规范!
  • Loading branch information
Jerry-306 authored May 21, 2022
commit 38b10bcbfdb3f90f6af93a5b196ca0f68463d744
4 changes: 2 additions & 2 deletions problems/0047.全排列II.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ var permuteUnique = function (nums) {

function backtracing( used) {
if (path.length === nums.length) {
result.push(path.slice())
result.push([...path])
return
}
for (let i = 0; i < nums.length; i++) {
Expand Down Expand Up @@ -303,7 +303,7 @@ function permuteUnique(nums: number[]): number[][] {
return resArr;
function backTracking(nums: number[], route: number[]): void {
if (route.length === nums.length) {
resArr.push(route.slice());
resArr.push([...route]);
return;
}
for (let i = 0, length = nums.length; i < length; i++) {
Expand Down

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