public static boolean process(String str){ int count = 1; for(int index = 0;index < str.length() - 1;++index){ if(str.charAt(index) == str.charAt(index + 1)){ ++count; str = str.substring(0,index) + str.substring(index + 2); index -= 2; } } System.out.println(str); return count % 2 != 0; }
点赞 5

相关推荐

03-03 23:42
复旦大学 Java
_无论云泥意贯一:把复旦大学放前面,山东大学放后面,并且在两个大学后面标注985(用一些显眼的颜色标注)
点赞 评论 收藏
分享
正在热议
更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务