Permutations

Given an array of distinct integers, the task is to return all possible permutations of the array. The permutations can be returned in any order.

Constraints

  • 1 <= nums.length <= 6
  • -10 <= nums[i] <= 10
  • All the integers of nums are unique.
Saving… · 2 lines
class Solution:
def findPermutations(self, nums: List[int]) -> List[List[int]]:
Console

Click Run to execute sample tests.