You are viewing a single comment's thread. Return to all comments →
if(s.length()%2!=0){ return -1; }else{ String p=s.substring(0, s.length()/2); String q=s.substring(s.length()/2); for(int i=0;i<p.length();i++){ if(q.contains(p.charAt(i)+"")){ q=q.replaceFirst(p.charAt(i)+"", ""); } } return q.length(); }
Seems like cookies are disabled on this browser, please enable them to open this website
Anagram
You are viewing a single comment's thread. Return to all comments →
Java