You are viewing a single comment's thread. Return to all comments →
java simple solution
public static String superReducedString(String s) { String tempStr = ""; for (int i = 0; i < s.length()-1; i++) { if (s.charAt(i) == s.charAt(i+1)) { tempStr = s.substring(0, i) + s.substring(i+2); return superReducedString(tempStr); } } if (s.length() == 0) { return "Empty String"; } return s; }
Seems like cookies are disabled on this browser, please enable them to open this website
Super Reduced String
You are viewing a single comment's thread. Return to all comments →
java simple solution