We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 919aecc commit 6779f87Copy full SHA for 6779f87
cpp/242-Valid-Anagram.cpp
@@ -0,0 +1,10 @@
1
+class Solution {
2
+public:
3
+ bool isAnagram(string s, string t) {
4
+ vector<int> count(26, 0);
5
+ for (auto a: s) count[a-'a']++;
6
+ for (auto a: t) count[a-'a']--;
7
+ for (auto c: count) if(c) return false;
8
+ return true;
9
+ }
10
+};
0 commit comments