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 0fc7ec8 commit a4b29c7Copy full SHA for a4b29c7
valid-anagram/kimjunyoung90.java
@@ -0,0 +1,18 @@
1
+public class kimjunyoung90 {
2
+ public boolean isAnagram(String s, String t) {
3
+ if(s.length() != t.length()) return false;
4
+
5
+ int[] count = new int[26];
6
7
+ for (int i = 0; i < s.length(); i++) {
8
+ count[s.charAt(i) - 'a']++;
9
+ count[t.charAt(i) - 'a']--;
10
+ }
11
12
+ for(int c : count) {
13
+ if (c != 0) return false;
14
15
16
+ return true;
17
18
+}
0 commit comments