bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
MediumBacktrackingLC 46

Permutations

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

Asked at 24 companies
AdobeAmazonApple
Hints
  • 1.Think about what data structure fits Permutations
  • 2.Consider the brute force complexity and how to optimize
  • 3.Can you trade space for time?
LeetCodeNeetCode