Python BinaryGap - binary gap within a positive integer N
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
def solution(N):
# write your code in Python 3.6
#Converts N to a string with binary eq of int N
decToBinary = bin(N).replace("0b", "")
answer = 0
counter = 0
for i in decToBinary:
if i == '1':
if answer < counter:
answer = counter
counter = 0
else:
counter += 1
return answer
"""
Loops string with binary eq of N
if it finds 1
check if current max < counter
update it if it is
reset counter
update counter
return counter
"""