C++ || Hashmap || Easy ✅ || Beats 93% 🔥
Code\n\nclass Solution {\npublic:\n    string entityParser(string text) {\n\n        unordered_map<string,char> mp {{"&quot;",\'"\'},{"&apos;",\'\\\'\'},{"&amp;
# Code\n```\nclass Solution {\npublic:\n    string entityParser(string text) {\n\n        unordered_map<string,char> mp {{"&quot;",\'"\'},{"&apos;",\'\\\'\'},{"&amp;",\'&\'},{"&gt;",\'>\'},{"&lt;",\'<\'},{"&frasl;",\'/\'}};\n        int i=0;\n        int n=text.length();\n        string ans="";\n        while(i<n)\n        {\n            if(text[i]==\'&\')\n            {\n                string temp="&";\n                i++;\n                while(i<n)\n                {\n                    if(text[i]==\';\')\n                    {\n                        temp+=\';\';\n                        auto it=mp.find(temp);\n                        if(it!=mp.end()) ans+=it->second;\n                        else ans+=temp;\n                        break;\n                    }\n                    else if(text[i]==\'&\')\n                    {\n                        ans+=temp;\n                        temp="&";\n                    }\n                    else temp+=text[i];\n                    i++;\n                }\n                if(temp[temp.length()-1]!=\';\') ans+=temp;\n            }\n            else ans+=text[i];\n            i++;\n        }\n        return ans;\n    }\n};\n```
['String', 'C++']