Algorithm · Square · Medium
You receive an array consisting only of 0s and 1s, representing a signal over time. Split it into runs of consecutive identical values and use the length of each run to translate the signal into Morse code: runs become dots, dashes, and pauses. After producing that Morse text, decode it into an English sentence. A mapping from Morse symbol sequences to letters is provided for this step. Constraints: Every element of the input array is either 0 or 1. A symbol-to-letter map is…