Skip to content

Commit 24e71a5

Browse files
committed
solve 242
1 parent 6ca06af commit 24e71a5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

valid-anagram/mumunuu.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import java.util.Arrays;
2+
3+
class Solution {
4+
public boolean isAnagram(String s, String t) {
5+
6+
if (s.length() != t.length()) {
7+
return false;
8+
}
9+
10+
char[] a = s.toCharArray();
11+
char[] b = t.toCharArray();
12+
13+
Arrays.sort(a);
14+
Arrays.sort(b);
15+
16+
return Arrays.equals(a, b);
17+
18+
}
19+
}

0 commit comments

Comments
 (0)