[Algorithm] GenomicRangeQuery
by Jeonghyeok Park
[Code]
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
def solution(A):
# write your code in Python 3.6
answer = 0
zero_cnt = 0
one_cnt = 1
for i in A:
if i == 0:
zero_cnt +=1
if i == 1:
answer += zero_cnt * one_cnt
if answer > 1000000000:
return -1
return answer
pass
Subscribe via RSS