1309. Decrypt String from Alphabet to Integer Mapping Easy
1/**
2 * [1309] Decrypt String from Alphabet to Integer Mapping
3 *
4 * You are given a string s formed by digits and '#'. We want to map s to English lowercase characters as follows:
5 *
6 * Characters ('a' to 'i') are represented by ('1' to '9') respectively.
7 * Characters ('j' to 'z') are represented by ('10#' to '26#') respectively.
8 *
9 * Return the string formed after mapping.
10 * The test cases are generated so that a unique mapping will always exist.
11 *
12 * Example 1:
13 *
14 * Input: s = "10#11#12"
15 * Output: "jkab"
16 * Explanation: "j" -> "10#" , "k" -> "11#" , "a" -> "1" , "b" -> "2".
17 *
18 * Example 2:
19 *
20 * Input: s = "1326#"
21 * Output: "acz"
22 *
23 *
24 * Constraints:
25 *
26 * 1 <= s.length <= 1000
27 * s consists of digits and the '#' letter.
28 * s will be a valid string such that mapping is always possible.
29 *
30 */
31pub struct Solution {}
32
33// problem: https://leetcode.com/problems/decrypt-string-from-alphabet-to-integer-mapping/
34// discuss: https://leetcode.com/problems/decrypt-string-from-alphabet-to-integer-mapping/discuss/?currentPage=1&orderBy=most_votes&query=
35
36// submission codes start here
37
38impl Solution {
39 pub fn freq_alphabets(s: String) -> String {
40 String::new()
41 }
42}
43
44// submission codes end
45
46#[cfg(test)]
47mod tests {
48 use super::*;
49
50 #[test]
51 fn test_1309() {
52 }
53}
54
Back
© 2025 bowen.ge All Rights Reserved.