1079. Letter Tile Possibilities
Approach 1: Generate All permutations
Use itertools
to generate all the permutations of the given string, of all possible lengths and then add the number of unique strings in that list to get the answer
This solution although not the best comes in at 93.51% percentile at 48ms
Time Complexity: O(n!)
Space Complexity: O(n!) [since all strings are being stored, albeit temporarily]
Last updated