You are viewing a single comment's thread. Return to all comments →
static boolean isAnagram(String a, String b) {
if(a.length() != b.length())return false; char[] c1 = a.toLowerCase().toCharArray(); char[] c2 = b.toLowerCase().toCharArray(); java.util.Arrays.sort(c1); java.util.Arrays.sort(c2); for(int i=0; i<c1.length; i++){ if(c1[i]!=c2[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 →
static boolean isAnagram(String a, String b) {