human
I found an interesting problem on https://leetcode.com/problems/letter-tile-possibilities/:
You have n  tiles, where each tile has one letter tiles[i] printed on it.
Return the number of possible non-empty sequences of letters you can make using the letters printed on those tiles.
 
Example 1:
Input: tiles = "AAB"
Output: 8
Explanation: The possible sequences are "A", "B", "AA", "AB", "BA", "AAB", "ABA", "BAA".

Example 2:
Input: tiles = "AAABBC"
Output: 188

Example 3:
Input: tiles = "V"
Output: 1

 
Constraints:

1 <= tiles.length <= 7
tiles consists of uppercase English letters.

I tried it in Python, but could not do it. Can you solve it?

=====
Give me a the Python program you requested?
assistant
#Here is the Python program you requested.

class Solution:
    def numTilePossibilities(self, tiles: str) -> int:
        res = set()
        def dfs(path, t):
            if path not in res:
                if path:
                    res.add(path)
                for i in range(len(t)):
                    dfs(path+t[i], t[:i] + t[i+1:])
                
        dfs('', tiles)
        return len(res)