Z09
Encrypted Message Decoding Ways
Problem Statement & Objective
Find all valid decodings of ambiguous encrypted telemetry streams.
Function Signature (Python)
encrypted_message_decoding_ways(message: str, dictionary: list[str]) -> intInput & 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 <= 100Example Execution Walkthrough
mesaj = "kalemlik", sozluk = ["kalem","lik","ka","lem"]
1) "kalem" + "lik"
2) "ka" + "lem" + "lik"
cevap: 2Example Test Scenarios (3)
Example 1
Input:
["kalemlik",["kalem","lik","ka","lem"]]Expected Output:
2Example 2: Küçük Mesaj Alternatif Ayrıştırma
Input:
["kod",["k","o","d","ko"]]Expected Output:
2Example 3: Tek Valid Yol
Input:
["test",["te","st"]]Expected Output:
1