HashMap | StringBuilder | No Short cut | Solution | Java
\nclass Solution {\n    public String entityParser(String s) {\n        Map<String,String> map = new HashMap<>();\n        map.put("&quot;",Character.toString(\
```\nclass Solution {\n    public String entityParser(String s) {\n        Map<String,String> map = new HashMap<>();\n        map.put("&quot;",Character.toString(\'"\'));\n        map.put("&apos;","\'");\n        map.put("&amp;","&");\n        map.put("&gt;",">");\n        map.put("&lt;","<");\n        map.put("&frasl;","/");\n        int start=0;\n        StringBuilder sb = new StringBuilder();\n        while(start<s.length()){\n            if(s.charAt(start)==\'&\'){ \n                String res ="";\n                while(start<s.length() && s.charAt(start)==\'&\'){\n                    sb.append(s.charAt(start));\n                    start++;\n                }\n                sb.deleteCharAt(sb.length()-1);\n                res+="&";\n                while(start<s.length()&& s.charAt(start)!=\';\'){\n                    res+=s.charAt(start);\n                    start++; \n                }\n                if(start<s.length())\n                    res+=s.charAt(start);\n                if(map.containsKey(res))\n                    sb.append(map.get(res));\n                else\n                    sb.append(res);\n            }\n            else sb.append(s.charAt(start));\n            start++;\n        }\n        return sb.toString(); \n    }\n}\n```
[]