第二题递归更容易 public static boolean check(String s){ if(s.length()==0)return true; if(s.contains("01") || s.contains("23")){ s = s.replaceAll("01",""); s = s.replaceAll("23",""); }else { return false; } return check(s); }
2 9

相关推荐

程序员超好吃:不是,这不是最基本的吗,前端后端测试agent不可能都投啊。别人问你英雄联盟打哪个位置,你说全能,那不就是都不行吗
点赞 评论 收藏
分享
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务