You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let codes = [".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."]
let codesStartOffset = Unicode.Scalar("a").value
func uniqueMorseRepresentations(_ words: [String]) -> Int {
var morseSet = Set<String>()
words.forEach{ word in
var morse = ""
for letter in word {
let letterString = String(letter)
let letterOffset = Int(Unicode.Scalar(letterString)!.value - codesStartOffset)