You are viewing a single comment's thread. Return to all comments →
this is complete code for this, we have to convert both string into lowercase or uppercase then we can continue arrays method
static boolean isAnagram(String a, String b) { int alen=a.length(); int blen=b.length(); a = a.toLowerCase(); b = b.toLowerCase(); if(alen!=blen){ return false; }else { char[] A=a.toCharArray(); char[] B=b.toCharArray(); java.util.Arrays.sort(A); java.util.Arrays.sort(B); return java.util.Arrays.equals(A, B); } }
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 →
this is complete code for this, we have to convert both string into lowercase or uppercase then we can continue arrays method