Unique Permutations

medium
Unit 16 · Backtracking0/3 to milestone

Return all unique permutations of a list that may contain duplicates, in lexicographic order, without generating duplicates and filtering them afterwards.

Also implement next_permutation(nums): rearrange nums in place into the next lexicographically greater permutation, or the smallest (sorted) one if it's already the largest. Return nothing.

#backtracking#combinatorics2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Unique Permutations · TechGradify