We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
staticbooleanisAnagram(Stringa,Stringb){// Complete the functionif(a.length()!=b.length())returnfalse;a=a.toUpperCase();b=b.toUpperCase();intlen=a.length();for(inti=0;i<len;i++){try{charA=a.charAt(i);intindex=b.indexOf(A);b=b.substring(0,index)+b.substring(index+1,b.length());}catch(Exceptione){returnfalse;}
Java Anagrams
You are viewing a single comment's thread. Return to all comments →
}