Skip to content

Latest commit

 

History

History
17 lines (8 loc) · 413 Bytes

Permutations.md

File metadata and controls

17 lines (8 loc) · 413 Bytes

Permutations

Problem Statement

Write a function that takes in an array of unique integers and returns an array of all permutations of those integers. If the input array is empty, your function should return an empty array.

Sample input: [1, 2, 3]

Sample output: [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]

Solution

Check this Python code.