You are viewing a single comment's thread. Return to all comments →
I did it like this:
if(a.length() != b.length()) return false; a.toLowerCase(); b.toLowerCase(); char[] arra = a.toCharArray(); char[] arrb = b.toCharArray(); Arrays.sort(arra); Arrays.sort(arrb); return Arrays.equals(arra, arrb);
and I still can't pass testcase #2 and #8... there are strings "hello" and "Hello" and program says "Not Anagrams"... WHY?
Seems like cookies are disabled on this browser, please enable them to open this website
Day 2: Conditional Statements: Switch
You are viewing a single comment's thread. Return to all comments →
I did it like this:
and I still can't pass testcase #2 and #8... there are strings "hello" and "Hello" and program says "Not Anagrams"... WHY?