Distinct tile sequences
Your task
Given a string tiles of uppercase letters (possibly with duplicates), return the number of distinct non-empty sequences you can form using the tiles, where each tile may be used at most once. For example with tiles AAB, sequences include A, B, AA, AB, BA, AAB, ABA, BAA. The string has length 1..10.
Examples
num_tile_possibilities(tiles: str) -> intExample 1
Input
num_tile_possibilities("AAB")Output
8