You have a few numbers, and all of them are different. Put them in a row. Each different order is called a permutation.
Return every permutation of nums. You can give the answer in any order.
Examples
Example 1:
Input: nums = [5,6,7]
Output: [[5,6,7],[5,7,6],[6,5,7],[6,7,5],[7,5,6],[7,6,5]]
Explanation: Three different numbers can be arranged in 3 x 2 x 1 = 6 ways.
Example 2:
Input: nums = [8,3]
Output: [[8,3],[3,8]]
Explanation: Two numbers can be arranged in 2 ways.
Example 3:
Input: nums = [4]
Output: [[4]]
Explanation: One number can only be arranged in one way.