File tree Expand file tree Collapse file tree 1 file changed +0
-31
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Original file line number Diff line number Diff line change 33import java .util .HashMap ;
44import java .util .Map ;
55
6- /**
7- * 1309. Decrypt String from Alphabet to Integer Mapping
8- *
9- * Given a string s formed by digits ('0' - '9') and '#' . We want to map s to English lowercase characters as follows:
10- * Characters ('a' to 'i') are represented by ('1' to '9') respectively.
11- * Characters ('j' to 'z') are represented by ('10#' to '26#') respectively.
12- * Return the string formed after mapping.
13- * It's guaranteed that a unique mapping will always exist.
14- *
15- * Example 1:
16- * Input: s = "10#11#12"
17- * Output: "jkab"
18- * Explanation: "j" -> "10#" , "k" -> "11#" , "a" -> "1" , "b" -> "2".
19- *
20- * Example 2:
21- * Input: s = "1326#"
22- * Output: "acz"
23- *
24- * Example 3:
25- * Input: s = "25#"
26- * Output: "y"
27- *
28- * Example 4:
29- * Input: s = "12345678910#11#12#13#14#15#16#17#18#19#20#21#22#23#24#25#26#"
30- * Output: "abcdefghijklmnopqrstuvwxyz"
31- *
32- * Constraints:
33- * 1 <= s.length <= 1000
34- * s[i] only contains digits letters ('0'-'9') and '#' letter.
35- * s will be valid string such that mapping is always possible.
36- * */
376public class _1309 {
387 public static class Solution1 {
398 //TODO: very silly solution, optimze it
You can’t perform that action at this time.
0 commit comments