g1001_1100.s1079_letter_tile_possibilities.readme.md Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leetcode-in-java Show documentation
Show all versions of leetcode-in-java Show documentation
Java-based LeetCode algorithm problem solutions, regularly updated
The newest version!
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.
© 2015 - 2024 Weber Informatics LLC | Privacy Policy