C++✅✅ | Faster🚀 than 80%🔥 | Very Simple Solution👌 | Clean & Concise Code |
\n\n# Code\n\n\nclass Solution {\npublic:\nstring entityParser(string t) {    \n    unordered_map<string,int>mpp ={{"&quot;",34},{"&apos;",39},{"&amp;",38},{"&g
\n\n# Code\n```\n\nclass Solution {\npublic:\nstring entityParser(string t) {    \n    unordered_map<string,int>mpp ={{"&quot;",34},{"&apos;",39},{"&amp;",38},{"&gt;",62},{"&lt;",60},{"&frasl;",47}};\n    string ans = "";\n    for(int i = 0; i < t.size();)\n    {\n        if(t[i]==\'&\')\n        {\n          int j = i;\n          string s;\n          bool f = 0;\n          while(j<t.size() && t[j]!=\';\')\n          {\n            if(f==0) f = 1;\n            else if(f==1&&t[j]==\'&\')\n            {\n              ans = ans+s;\n              s.clear();\n            }\n            s.push_back(t[j++]);\n          }\n          if(t[j]==\';\') s.push_back(t[j]);\n          if(mpp.find(s)!=mpp.end())\n          {\n            char ch = char(mpp[s]);\n            ans.push_back(ch);\n          }\n          else  ans = ans + s;\n          i = j+1;\n        }\n        else ans.push_back(t[i++]); \n    }\n      return ans;\n    }\n};\n\n\n```
['C++']