Java | String | Easy Implementation
\nclass Solution {\n    public boolean areAlmostEqual(String s1, String s2) {\n        if(s1.equals(s2))\n            return true;\n        List<Integer> l = ne
```\nclass Solution {\n    public boolean areAlmostEqual(String s1, String s2) {\n        if(s1.equals(s2))\n            return true;\n        List<Integer> l = new ArrayList<>();\n        for (int i = 0; i < s1.length(); i++) {\n            if (s1.charAt(i) != s2.charAt(i)) \n                l.add(i);\n\t\t\tif (l.size() > 2) \n                return false;\n        }\n        if(l.size()==2 && s1.charAt(l.get(0))==s2.charAt(l.get(1)) && s1.charAt(l.get(1))==s2.charAt(l.get(0)))\n            return true;\n        return false;\n    }\n}\n```\nKindly upvote if you like the code.
['Array', 'String', 'Java']