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 25ed955 commit 64c2bdfCopy full SHA for 64c2bdf
1 file changed
valid-anagram/hjeomdev.java
@@ -0,0 +1,21 @@
1
+class Solution {
2
+ public boolean isAnagram(String s, String t) {
3
+ if (s.length() != t.length()) {
4
+ return false;
5
+ }
6
+
7
+ String[] sList = s.split("");
8
+ Arrays.sort(sList);
9
+ String[] tList = t.split("");
10
+ Arrays.sort(tList);
11
12
+ for (int i = 0; i < s.length(); i++) {
13
+ // System.out.println(sList[i] + " " + tList[i]);
14
+ if (!sList[i].equals(tList[i])) {
15
16
17
18
19
+ return true;
20
21
+}
0 commit comments