Z09

Encrypted Message Decoding Ways

Staff / Principal Engineer
Target Time: 40 - 50 Minutes
Type: NUMERIC

Problem Statement & Objective

Find all valid decodings of ambiguous encrypted telemetry streams.

Function Signature (Python)

encrypted_message_decoding_ways(message: str, dictionary: list[str]) -> int

Input & Output Contract

Output Rule:[0, 1.000.000.006] aralığında tam sayı. Boş mesaj için 1.

System Constraints

0 <= mesaj.length <= 10^5
1 <= sozluk.length <= 10^4
tüm metinler küçük ASCII harf
0 < sözlük[i].length <= 100

Example Execution Walkthrough

mesaj = "kalemlik", sozluk = ["kalem","lik","ka","lem"]
1) "kalem" + "lik"
2) "ka" + "lem" + "lik"
cevap: 2

Example Test Scenarios (3)

Example 1
Input:["kalemlik",["kalem","lik","ka","lem"]]
Expected Output:2
Example 2: Küçük Mesaj Alternatif Ayrıştırma
Input:["kod",["k","o","d","ko"]]
Expected Output:2
Example 3: Tek Valid Yol
Input:["test",["te","st"]]
Expected Output:1
Loading Python Editor...
Input Parameters
[
  "kalemlik",
  [
    "kalem",
    "lik",
    "ka",
    "lem"
  ]
]
Expected Output
2