Hi si please help with it.

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 26VE
icon
Related questions
Question

Hi si please help with it. 

 

2 International Morse Code defines a standard encoding where each letter is mapped to
3
a series of dots and dashes, as follows: "a" maps to ".-", "b" maps to "-...", "c"
maps to "-.-.", and so on.
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
72 73 74 75 76 7 78 79 80
For convenience, the full table for the 26 letters of the English alphabet is given below:
'a':".-",
'b':"-...",
'c':"-.-.",
'd': "..
'e': ".",
'f':"...",
77
35
36
37
38
39
Return the number of different transformations among all words we have.
40 Example:
41
Input: word
42
Output: 2
43
Explanation:
44 The transformation of each word is:
45 "gin"
46 "zen" ->
47
"gig" ->
48
"msg" ->
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Now, given a list of words, each word can be written as a concatenation of the
Morse code of each letter. For example, "cab" can be written as "-.-.-....-"
(which is the concatenation "-.-." + '-..." + ".-"). We'll call such a
concatenation, the transformation of a word.
'i':
'j'
'g'
'm':
'n':"-
'i':
'j':
'k':
'p':
There are 2 different transformations, "--...- and "--...--.".
'm'
'n':
'y":"-
morse_code = {
'a':".-",
'b':"-
'd':
'e': ".
'q':
'y'
= ["gin", "zen", "gig", "msg"]
Transcribed Image Text:2 International Morse Code defines a standard encoding where each letter is mapped to 3 a series of dots and dashes, as follows: "a" maps to ".-", "b" maps to "-...", "c" maps to "-.-.", and so on. 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 72 73 74 75 76 7 78 79 80 For convenience, the full table for the 26 letters of the English alphabet is given below: 'a':".-", 'b':"-...", 'c':"-.-.", 'd': ".. 'e': ".", 'f':"...", 77 35 36 37 38 39 Return the number of different transformations among all words we have. 40 Example: 41 Input: word 42 Output: 2 43 Explanation: 44 The transformation of each word is: 45 "gin" 46 "zen" -> 47 "gig" -> 48 "msg" -> 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 Now, given a list of words, each word can be written as a concatenation of the Morse code of each letter. For example, "cab" can be written as "-.-.-....-" (which is the concatenation "-.-." + '-..." + ".-"). We'll call such a concatenation, the transformation of a word. 'i': 'j' 'g' 'm': 'n':"- 'i': 'j': 'k': 'p': There are 2 different transformations, "--...- and "--...--.". 'm' 'n': 'y":"- morse_code = { 'a':".-", 'b':"- 'd': 'e': ". 'q': 'y' = ["gin", "zen", "gig", "msg"]
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning