1 Liners for [C++/Python/Java]
Python 1 LinerC++ 1 LinerJava 1 Liner
# Python 1 Liner
```Python []
areAlmostEqual = lambda s1, s2: s1 == s2 or (lambda d: len(d) == 2 and s1[d[0]] == s2[d[1]] and s1[d[1]] == s2[d[0]])([i for i in range(len(s1)) if s1[i] != s2[i]])
```
# C++ 1 Liner
```cpp []
class Solution {
public:
    int cnt = 0; char a, b;
    bool areAlmostEqual(string s, string t) {
        for (int i = 0; i < s.size(); i++) cnt = s[i] != t[i] ? cnt == 0 ? (a = s[i], b = t[i], cnt + 1) : cnt == 1 ? (s[i] == b && t[i] == a ? cnt + 1 : 3) : 3 : cnt;
        return cnt == 0 || cnt == 2;
    }
};
```

# Java 1 Liner

```Java []
class Solution {
    public boolean areAlmostEqual(String s1, String s2) {
        return s1.equals(s2) || java.util.stream.IntStream.range(0, s1.length()).filter(i -> s1.charAt(i) != s2.charAt(i)).boxed().collect(java.util.stream.Collectors.collectingAndThen(java.util.stream.Collectors.toList(), l -> l.size() == 2 && s1.charAt(l.get(0)) == s2.charAt(l.get(1)) && s1.charAt(l.get(1)) == s2.charAt(l.get(0))));
    }
}
```


['C++']