Class Solution

  • All Implemented Interfaces:

    
    public final class Solution
    
                        

    1079 - Letter Tile Possibilities\.

    Medium

    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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      Solution()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Integer numTilePossibilities(String tiles)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait