Skip to content

Commit a79fa6c

Browse files
feat: add LeetCode problem 2068
:D
1 parent e5dad3f commit a79fa6c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

leetcode/src/2068.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
bool checkAlmostEquivalent(char* word1, char* word2)
2+
{
3+
int map[26] = {0};
4+
int len = strlen(word1);
5+
6+
for (int i = 0; i < len; i++)
7+
{
8+
map[word1[i] - 'a']++;
9+
map[word2[i] - 'a']--;
10+
}
11+
for (int i = 0; i < 26; i++)
12+
{
13+
if (map[i] > 3 || map[i] < -3)
14+
return (false);
15+
}
16+
return (true);
17+
}
18+

0 commit comments

Comments
 (0)