C(Not c++) Solution using hash table
IntuitionThis is a very easy problem, however it is easy to mess up annoying test cases which gives it the 49.1% acceptance rate.ApproachIn my approach there ar
# Intuition
This is a very easy problem, however it is easy to mess up annoying test cases which gives it the 49.1% acceptance rate.



# Approach
In my approach there are  three different confirmations in place to determine true or false
- Are the strings the same length? If not false
- Are there either none or two mismatches in the strings? If not false
- Finally if hashed into the same table are all the values equal to 0

This allows us to have an early exit if they aren't the same length
Determine if one switch is not enough
Finally make sure all the same letters are used 

# Complexity
- Time complexity:
O(n + m) This can be done easily in O(n) however I wanted to use a hash table

- Space complexity:
O(1)

# Code
```c []
bool areAlmostEqual(char* s1, char* s2) {
    int len1 = strlen(s1);
    int len2 = strlen(s2);
    int * hash = calloc(sizeof(int), 26);
    if(len1 != len2) return false;
    int error = 0;
    for(int i = 0; i < len1; i++){
        if(s1[i] != s2[i]) error++;
        hash[s1[i] - 'a']++;
        hash[s2[i] - 'a']--;
    }
    for(int i = 0; i < 26; i++){
        if(hash[i] != 0) return false;
    }
    return((error == 2 || error == 0));
}
```
['C']