Your task is to implement a function that counts the distinct sequences that can be formed using a given set of tile characters. The function should handle the frequency of each tile character and compute the number of unique permutations of those characters.
Functionality Requirements
Implement a function with the following signature:
python
def count_tile_sequences(tiles: str) -> int:
The function should:
Take a string tiles as input, where each character represents a different type of tile.
Count the number of distinct sequences that can be formed using the characters in the string tiles.
Return the result as an integer, which is the count of unique permutations minus one (to exclude the empty sequence).
Input/Output Requirements
Input:
The function will receive a single parameter:
tiles: A string (1 <= len(tiles) <= 7) consisting of uppercase English letters representing the tile characters.
Output:
The function will return an integer representing the number of unique sequences that can be formed from the input tiles minus one.
Example
python
count_tile_sequences("AAB")
# should return 5 (the unique sequences are: "AAB", "ABA", "BAA", "AA", and "B")
Implementation
Ensure that the solution is written in a file called /app/solution.py.