Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/neetcode-gh/leetcode
/ permute
Function
permute
javascript/0046-permutations.js:7–9 ·
view source on GitHub ↗
(nums)
Source
from the content-addressed store, hash-verified
5
* @
return
{number[][]}
6
*/
7
var
permute =
function
(nums) {
8
return
dfs(nums);
9
};
10
11
var
dfs =
function
(nums, permutation = [], permutations = []) {
12
const
isBaseCase = nums.length === permutation.length;
Callers
nothing calls this directly
Calls
2
dfs
Function · 0.70
bfs
Function · 0.70
Tested by
no test coverage detected