Java Easy Soltuion using hashmap
\nclass Solution {\n    public String entityParser(String text) {\n        String ans = "";\n        HashMap<String, String> map = new HashMap<>();\n        map
```\nclass Solution {\n    public String entityParser(String text) {\n        String ans = "";\n        HashMap<String, String> map = new HashMap<>();\n        map.put("&quot;", "\\"");\n        map.put("&apos;", "\'");\n        map.put("&amp;", "&");\n        map.put("&gt;", ">");\n        map.put("&lt;", "<");\n        map.put("&frasl;", "/");\n        \n        for(int i=0; i<text.length(); i++){\n            \n            if(text.charAt(i) == \'&\'){\n                String s = "";\n                \n                while(i < text.length()){\n                    s += text.charAt(i);\n                    if(text.charAt(i) == \';\'){\n                        if(map.containsKey(s)){\n                            ans += map.get(s);   \n                        }else{\n                            ans += s; \n                        }\n                        break;\n                    }else i++;\n                    \n                    if(text.charAt(i) == \'&\'){\n                        ans += s;\n                        i--;\n                        break;\n                    }\n                }\n            }else{\n                ans += text.charAt(i);\n            }\n        }\n        \n        return ans;\n    }\n}\n```
[]