1class Solution {2public:3string convert(string st) {4string s1[] = {".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..",5".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.",6"...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."};7string s = "";8for (char a : st) {9s += s1[a - 'a'];10}11return s;12}13int uniqueMorseRepresentations(vector<string> &words) {14set<string> st;15for (int i = 0; i < words.size(); i++) {16st.insert(convert(words[i]));17}1819return st.size();20}21};