You are viewing a single comment's thread. Return to all comments →
Great answer, but how 'bout checking input params for runtime exceptions? With 9 test cases, you never know...
static boolean isAnagram(String A, String B) { //Complete the function Boolean retValue = false; if(A != null && B != null) { char [] arrayA = A.toLowerCase().toCharArray(); char [] arrayB = B.toLowerCase().toCharArray(); Arrays.sort(arrayA); Arrays.sort(arrayB); retValue = Arrays.equals(arrayA, arrayB); } return retValue; }
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 →
Great answer, but how 'bout checking input params for runtime exceptions? With 9 test cases, you never know...