Skip to content

Commit 73efe53

Browse files
dohee789dohee789
authored andcommitted
👔 valid-anagram solution
1 parent 63adcb0 commit 73efe53

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

valid-anagram/dohee789.java

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

0 commit comments

Comments
 (0)