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

相关推荐

码农索隆:你告诉他,你看他也一般
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务