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 4e5b362 commit d960abeCopy full SHA for d960abe
valid-anagram/ymir0804.java
@@ -0,0 +1,14 @@
1
+import java.util.Set;
2
+import java.util.stream.Collectors;
3
+
4
+class Solution {
5
+ public boolean isAnagram(String s, String t) {
6
+ Set<Character> characterS = s.chars()
7
+ .mapToObj(c -> (char) c)
8
+ .collect(Collectors.toSet());
9
+ Set<Character> characterT = t.chars()
10
11
12
+ return characterS.equals(characterT);
13
+ }
14
+}
0 commit comments