[JAVA] easy fast solution 0ms
\nclass Solution {\n    public boolean areAlmostEqual(String s1, String s2) {\n      if(s1.length() != s2.length()) return false;\n        if(s1.equals(s2)) ret
```\nclass Solution {\n    public boolean areAlmostEqual(String s1, String s2) {\n      if(s1.length() != s2.length()) return false;\n        if(s1.equals(s2)) return true;\n      \n      ArrayList<Integer> ans = new ArrayList<>();\n      \n      for(int i = 0; i < s1.length(); i ++){\n            if(s1.charAt(i) != s2.charAt(i)){\n                ans.add(i);\n            }\n        }\n      if(ans.size() == 2){\n            int x = ans.get(0);\n            int y = ans.get(1);\n        if(s1.charAt(x) == s2.charAt(y) && s1.charAt(y) == s2.charAt(x)) return true;\n      }\n      return false;\n    }\n}\n```\n# PLEASE UPVOTE IF IT WAS HELPFULL
['String', 'Java']