Java | easy to understand
\nclass Solution {\n    public boolean areAlmostEqual(String s1, String s2) {\n          if(s1.length()!=s2.length())\n           return false;\n        if(s1.e
```\nclass Solution {\n    public boolean areAlmostEqual(String s1, String s2) {\n          if(s1.length()!=s2.length())\n           return false;\n        if(s1.equals(s2))\n            return true;\n        else{\n             List<Integer> list = new ArrayList<>();\n            for (int i = 0;i<s1.length();i++)\n                if (s1.charAt(i) != s2.charAt(i)) list.add(i);\n            return list.size() == 2 && s1.charAt(list.get(0)) == s2.charAt(list.get(1)) && s2.charAt(list.get(0)) == s1.charAt(list.get(1));\n\n        }\n    }\n}\n```
['Java']