DIY: Permutations

Solve the interview question "Permutations" in this lesson.

Problem statement

Given an array nums of unique integers, you will return all the possible permutations. You can return the answer in any order.

Constraints

  • 1 <= nums.length <= 6
  • -10 <= nums[i] <= 10
  • All the integers of nums are unique.
Access this course and 1400+ top-rated courses and projects.