Given a string, list all possible combinations and permutations of its characters.

Examples:

`getCombPerms("a") ==> {"a"}`

`getCombPerms("ab") ==> {"a","ab","ba","b"}`

Need a **hand?** Try out these hints, one at a time.

`String`

, `null`

or a single character, the only permutation is the input itself.

1. Initialize an `ArrayList`

to store all the permutations.

2. Check for the base conditions i.e. if the input is `null`

, return the input itself. If the input is a single `Character`

or an empty `String`

, add it to the list.

3. Separate out the first character and recursively find the permutation of the remainder `String`

.

4. Iterate and insert the separated character at every position in all the words obtained from the recursive call.

5. Return the list of all the words.

public static ArrayList<String> getCombPerms(String s) { }

**C**

**Java**

**Python**