public class Main { public static void main(String[] args) { Scanner scanner=new Scanner(System.in); int a= Integer.valueOf(scanner.nextLine()); String seq=scanner.nextLine(); int from=0; int res=0; while (from<a-6){ from=seq.indexOf("ATG",from); if(from!=-1){ int[] tmp=new int[3]; tmp[0]=seq.indexOf("TAA",from+3); tmp[1]=seq.indexOf("TAG",from+3); tmp[2]=seq.indexOf("TGA",from+3); Arrays.sort(tmp); for(int one:tmp){ if(one>from){ from=one+3; res++; break; } } ====我少加了这两行40%没过,看到了😂 System.out.println(0); return; ================== }else { from=13; } } System.out.println(res); scanner.close(); } }

相关推荐

牛客网
牛客企业服务