题解 | #DNA序列#

挑7

http://www.nowcoder.com/practice/ba241b85371c409ea01ac0aa1a8d957b

str1 = input() num = int(input()) times = 0 l = [0] c = 0 for i in range(len(str1)): if i+num < len(str1): count_cg = str1[i:i + num].count('C') + str1[i:i + num].count('G') if count_cg > c: c=count_cg l[0]=str1[i:i + num] else: count_cg = str1[i:].count('C') + str1[i:].count('G') if count_cg > c: c=count_cg l[0]=str1[i:] print(l[0])

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务