Given a collection of distinct integers, return all possible permutations.There are three ways to solve this problem: using recursion, using next permutation, and using Heap's algorithm.The recursive approach involves fixing each digit and reversing the other digits recursively.The next permutation approach involves sorting the input array and generating the next higher number using the library function.