C++ 20 ms: STL, no useless copying, short and efficient code, annotated
\nclass Solution {\npublic:\n  int numUniqueEmails(std::vector<std::string>& emails) {             // take a note: it is not \'const\' ;)\n    if(emails.empty()
```\nclass Solution {\npublic:\n  int numUniqueEmails(std::vector<std::string>& emails) {             // take a note: it is not \'const\' ;)\n    if(emails.empty())\n      return {};\n\n    std::unordered_set<std::string> uniques;\n    for(auto& email : emails)\n    {\n      auto at   = std::find(std::begin(email), std::end(email), \'@\'); // task guaranteed that there will be one \'@\'\n\t  auto plus = std::find(std::begin(email), at, \'+\');              // search for the first \'+\' in range [begin, \'@\')\n\n      email.erase(std::remove(std::begin(email),                      // very common idiom called "remove-erase"\n                              plus != std::end(email) ? plus : at,    // if there\'s no \'+\' in the name, we trim to \'@\'\n                              \'.\'),\n                  at);\n\t  uniques.emplace(email);                                         // construct an \'email\' directly inside \'uniques\'\n    }\n\n    return static_cast<int>(uniques.size());                          // type safety :)\n  }\n};\n```
[]