Find a Position in a Genome Minimizing the Skew
来源:互联网 发布:淘宝童装店铺名 编辑:程序博客网 时间:2024/05/22 06:42
a=input()d={}c,g,m=0,0,0for i in range(len(a)): if a[i]=='C': c+=1 elif a[i]=='G': g+=1 d[i]=g-c #用字典保存每个i前缀g和c的个数差值 if d[i]<m: #用m保存最小的i值 m=d[i]for key in d.keys(): if d[key]==m: print(key+1,end=" ") #因为前缀的下标是从0开始的,对应到字符串上应该+1
阅读全文
0 0
- Find a Position in a Genome Minimizing the Skew
- Find the disappear numbers in a array
- Find the Longest Word in a String
- CareerCup Write a function that given a position returns the digit in that 0123456789101112131415..
- fwnx- find the common ancestor in a tree
- 1007. Find the middle element in a Linked List
- Find the second largest element in a Binary Search Tree
- Find the maximum subarray XOR in a given array
- Find the Minimum Element in A sorted and Rotated Array
- freecodecamp学习--Find the Longest Word in a String
- find the kth largest element in a list and find the first k largest elements in a list
- [Solved]Find a Child in a QTreeView
- Find a Mother Vertex in a Graph
- 438. Find All Anagrams in a String\389. Find the Difference
- Ch4.5: find the (in-order tranversely) successor of a node in BST.
- [Google]Find numbers of nodes in a BST in the range [low,high]
- Can not find a java.io.InputStream with the name [downloadFile] in the invocation stack问题解决
- Can not find a java.io.InputStream with the name [downloadFile] in the invocation stack问题解决
- Mysql事务级别详解
- poj1061青蛙的约会
- java框架 作业1
- JavaScript常见算法面试题
- android学习---活动的生命周期
- Find a Position in a Genome Minimizing the Skew
- Entity Framework Core 使用HiLo生成主键
- 使用Microsoft.AspNetCore.TestHost进行完整的功能测试
- Html5动画代码
- Map集合
- eclipse打包成可运行.jar文件
- IP分片与重组详解
- 一个挺好的复选框样式,单选框也一样适用
- 20171129 自省