Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 296 Bytes

File metadata and controls

26 lines (17 loc) · 296 Bytes

Problem 46: Permutations

Difficulty: Medium

Problem

Given a collection of distinct numbers, return all possible permutations.

Example

For example, [1,2,3] have the following permutations:

[
  [1,2,3],
  [1,3,2],
  [2,1,3],
  [2,3,1],
  [3,1,2],
  [3,2,1]
]