Generating All Permutations of Distinct Integers

# Introduction In this challenge, the objective is to generate every possible permutation of an array comprising distinct integers. The task is to write a function `permute`, which accepts an array `nums` and produces all of its possible permutations. The order of the output permutations is not significant. For instance, if an input array contains `[1, 2, 3]`, there are six possible permutations, such as `[[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]`. Let's start working on the `permute` function!

|60 : 00

Click the virtual machine below to start practicing