My EASY C++ Solution || Using Map 
IntuitionApproachYour approach uses a frequency map to compare the character counts of s1 and s2. First, it builds a frequency map for s1, then decrements the c
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->
Your approach uses a frequency map to compare the character counts of s1 and s2. First, it builds a frequency map for s1, then decrements the counts using s2. If the map is not empty, the strings have different character compositions, so they can't be made equal. Next, it counts mismatched positions and returns true if there are exactly two mismatches (indicating a valid swap) or zero mismatches (already equal). This approach runs in O(N) time and uses O(1) space since the map stores at most 26 characters. 

# Complexity
- Time complexity: O(N)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(26) ~ O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    bool areAlmostEqual(string s1, string s2) {
        int ct = 0;
        map<char, int> mp;

        for(int i=0; i<s1.length(); i++){
            mp[s1[i]]++;
        }

        for(int i=0; i<s2.length(); i++){
            mp[s2[i]]--;
            if (mp[s2[i]] == 0) {
                mp.erase(s2[i]);
            }
        }


        for(int i=0; i<s1.length(); i++)
        {
            if(s1[i] != s2[i]) ct++;
        }

        if(!mp.empty())
            return false;
        
        return ct == 2 || ct == 0;
        
    }
};
```
['Math', 'String', 'Ordered Map', 'C++']