Grokking 75: Top Coding Interview Questions
Ask Author
Back to course home

0% completed

Solution: Permutations II
Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Problem Statement

Given a list of numbers nums that might have duplicates, return all unique arrangements of the numbers in any order.

Examples

Example 1:

  • Input: nums = [1, 2, 2]
  • Output: [[1,2,2],[2,1,2],[2,2,1]]
  • Explanation: There are a total of 6 permutations of [1, 2, 2] list but only 3 are unique.

Example 2:

  • Input: nums = [2, 2, 3]
  • Output: [[2,2,3],[2,3,2],[3,2,2]]
  • Explanation: All unique permutations of the list [2, 2, 3] are shown above.

Example 3:

  • Input: nums = [1, 2, 2, 3]

.....

.....

.....

Like the course? Get enrolled and start learning!

Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible