Back to problems

Solve two string DP/hash problems

Algorithm · Amazon · Medium

Part 1 — Counting Distinct Morse Encodings You are given an array words, where every entry is a string made of lowercase English letters. Each letter a through z has a fixed International Morse code symbol, and a word is translated by concatenating the symbols of its letters in the order they appear. For example, "bat" becomes -... + .- + -, which is the single string -....--. The standard symbol for each letter, listed from a to z, is: [".-", "-...", "-.-.", "-..", ".",…

Checking your access…