1079. Letter Tile Possibilities Medium

@problem@discussion
#String#Backtracking



1/**
2 * [1079] Letter Tile Possibilities
3 *
4 * You have n  tiles, where each tile has one letter tiles[i] printed on it.
5 * Return the number of possible non-empty sequences of letters you can make using the letters printed on those tiles.
6 *  
7 * Example 1:
8 * 
9 * Input: tiles = "AAB"
10 * Output: 8
11 * Explanation: The possible sequences are "A", "B", "AA", "AB", "BA", "AAB", "ABA", "BAA".
12 * 
13 * Example 2:
14 * 
15 * Input: tiles = "AAABBC"
16 * Output: 188
17 * 
18 * Example 3:
19 * 
20 * Input: tiles = "V"
21 * Output: 1
22 * 
23 *  
24 * Constraints:
25 * 
26 * 	1 <= tiles.length <= 7
27 * 	tiles consists of uppercase English letters.
28 * 
29 */
30pub struct Solution {}
31
32// problem: https://leetcode.com/problems/letter-tile-possibilities/
33// discuss: https://leetcode.com/problems/letter-tile-possibilities/discuss/?currentPage=1&orderBy=most_votes&query=
34
35// submission codes start here
36
37impl Solution {
38    pub fn num_tile_possibilities(tiles: String) -> i32 {
39        0
40    }
41}
42
43// submission codes end
44
45#[cfg(test)]
46mod tests {
47    use super::*;
48
49    #[test]
50    fn test_1079() {
51    }
52}
53


Back
© 2025 bowen.ge All Rights Reserved.