AAM jindagi - MENTOS jindagi CPP easy to understand
Ye hai AAM Jindagi:\n\n\nclass Solution {\npublic:\n    string entityParser(string text) {\n        string res="";\n        string temp="";\n        \n        u
Ye hai AAM Jindagi:\n\n```\nclass Solution {\npublic:\n    string entityParser(string text) {\n        string res="";\n        string temp="";\n        \n        unordered_map<string,string> mp;\n        mp["&quot;"]="\\"";\n        mp["&apos;"]="\'";\n        mp["&amp;"]="&";\n        mp["&gt;"]=">";\n        mp["&lt;"]="<";\n        mp["&frasl;"]="/";\n            \n        for(char c:text)\n        {\n            if(mp.find(temp)!=mp.end())\n            {\n                res+=mp[temp];\n                temp="";\n                temp+=c;\n            }\n            else if(c==\'&\') \n            {\n                res+=temp;\n                temp="";\n                temp+=c;\n            }\n            else temp+=c;\n        }\n        if(mp.find(temp)!=mp.end())\n        {\n            res+=mp[temp];\n            temp="";\n        }\n        else\n        res+=temp;\n        return res;\n    }\n};\n```\n\nYe hai MENTOS Jindagi:\n\n```\nclass Solution {\npublic:\n    string entityParser(string text) {\n            unordered_map<string, string> mp = { {"&quot;", "\\""}, {"&apos;", "\\\'"}, {"&amp;", "&"}, {"&gt;", ">"}, {"&lt;", "<"}, {"&frasl;", "/"}};\n            for(auto& [key,value]:mp)\n            {\n                regex xx(key);\n                text=regex_replace(text,xx,value);\n            }\n            return text;\n    }\n};\n```
['C++']