30:00
Given an array nums that may contain duplicate values, return every distinct permutation of it. The permutations can be returned in any order.
1≤nums.length≤81 \leq \text{nums.length} \leq 81≤nums.length≤8
−10≤nums[i]≤10-10 \leq \text{nums}[i] \leq 10−10≤nums[i]≤10
Run code to see results.
nums = [1,1,2]. Equal values are interchangeable, so the goal is each distinct ordering exactly once.
Input
1
i=0
i=1
2
i=2
Path being built
3
Distinct permutations
found: 0
none yet
Given an array nums of up to 8 integers that may repeat, return every distinct permutation exactly once, in any order.