Write a function called permutations that takes in a string as a parameter and returns an array of all possible permutations of the characters in the string.
The execution time increases exponentially with each character. A lot of characters will cause the environment to hang as it tries to solve all the combinations. Avoid passing more than 8 characters.