Your Task: This is a function problem. You only need to complete the function permutation that takes S as parameter and returns the list of permutations in lexicographically increasing order. The newline is automatically added by driver code.
1 ≤ size of string ≤ 5
Expected Time Complexity: O(N * N!), N = length of string. Expected Auxiliary Space: O(1)