class Solution {
public:
int uniqueMorseRepresentations(vector<string>& words) {
map<char,string>mp;
set<string>ss;
string match[] = {".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."};
for(int i = 0;i<26;i++)
{
mp['a'+i] = match[i];
}
string s;
for(int i = 0;i<words.size();i++)
{
s = "";
for(int j = 0;j<words[i].size();j++)
{
s+= mp[words[i][j]];
}
ss.insert(s);
}
return ss.size();
}
};