Unique Email Addresses | Beat 90%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int numUniqueEmails(vector<string>& emails) {\n        int i, j, count, flag1=0;\n        for(i=0 ; i<emails.size() ; i++)\n        {\n            j=0;\n            flag1=0;\n            while(j<emails[i].size())\n            {\n                if(emails[i][j]==\'.\' && flag1==0)\n                {\n                    emails[i].erase(emails[i].begin()+j);\n                }\n                else if(emails[i][j]==\'@\')\n                {\n                    flag1=1;\n                    j++;\n                }\n                else if(emails[i][j]==\'+\' && flag1==0)\n                {\n                    while(emails[i][j]!=\'@\')\n                    {\n                        emails[i].erase(emails[i].begin()+j);\n                    }\n                }\n                else\n                {\n                    j++;\n                }\n            }\n        }\n        i=0;\n        while(i<emails.size())\n        {\n            j=i+1;\n            while(j<emails.size())\n            {\n                if(emails[i]==emails[j])\n                {\n                    emails.erase(emails.begin()+j);\n                }\n                else\n                {\n                    j++;\n                }\n            }\n            i++;\n        }\n        count = emails.size();\n        return count;\n    }\n};\n```
['C++']