133: Permutations

Given an array of distinct integers, return all possible permutations

 

Example 1

Input:   [1]

Output:  [[1]]

Example 2

Input:   [0, 1]

Output:  [[0, 1], [1, 0]]
Difficulty:Medium
Topic:Backtracking
Problem #:133