784. Letter Case Permutation Medium
1/**
2 * [784] Letter Case Permutation
3 *
4 * Given a string s, you can transform every letter individually to be lowercase or uppercase to create another string.
5 * Return a list of all possible strings we could create. Return the output in any order.
6 *
7 * Example 1:
8 *
9 * Input: s = "a1b2"
10 * Output: ["a1b2","a1B2","A1b2","A1B2"]
11 *
12 * Example 2:
13 *
14 * Input: s = "3z4"
15 * Output: ["3z4","3Z4"]
16 *
17 *
18 * Constraints:
19 *
20 * 1 <= s.length <= 12
21 * s consists of lowercase English letters, uppercase English letters, and digits.
22 *
23 */
24pub struct Solution {}
25
26// problem: https://leetcode.com/problems/letter-case-permutation/
27// discuss: https://leetcode.com/problems/letter-case-permutation/discuss/?currentPage=1&orderBy=most_votes&query=
28
29// submission codes start here
30
31impl Solution {
32 pub fn letter_case_permutation(s: String) -> Vec<String> {
33 vec![]
34 }
35}
36
37// submission codes end
38
39#[cfg(test)]
40mod tests {
41 use super::*;
42
43 #[test]
44 fn test_784() {
45 }
46}
47
Back
© 2025 bowen.ge All Rights Reserved.