47.Permutations-II

47. Permutations II

题目地址

https://leetcode.com/problems/permutations-ii/

https://www.lintcode.com/problem/permutations-ii/description

题目描述

Given a collection of numbers that might contain duplicates, return all possible unique permutations.

Example:

Input: [1,1,2]
Output:
[
  [1,1,2],
  [1,2,1],
  [2,1,1]
]

代码

Approach 2: 字典序

Last updated

Was this helpful?