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.
My solution. I don't use class Arrays from java.util.Arrays
staticbooleanisAnagram(Stringa,Stringb){// Complete the functionchar[]aa=a.toLowerCase().toCharArray();char[]bb=b.toLowerCase().toCharArray();if(aa.length!=bb.length)returnfalse;for(inti=0;i<aa.length;i++){chars1=aa[i];chars2=bb[i];intfs1=0;intfs2=0;for(intj=0;j<aa.length;j++){if(aa[j]==s1)fs1++;if(bb[j]==s1)fs2++;}if(fs1!=fs2)returnfalse;}returntrue;}
Cookie support is required to access HackerRank
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 →
My solution. I don't use class Arrays from java.util.Arrays