You are viewing a single comment's thread. Return to all comments →
JAVA 15
private static boolean isAnagram(String a, String b) { if(b.length() != a.length()) { return false; } else { char[] arrayA = a.toUpperCase().toCharArray(); char[] arrayB = b.toUpperCase().toCharArray(); Arrays.sort(arrayA); Arrays.sort(arrayB); for(int i=0; i< arrayA.length; i++) { if(arrayB[i] != arrayA[i]) { return false; } } return true; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Anagrams
You are viewing a single comment's thread. Return to all comments →
JAVA 15