You are viewing a single comment's thread. Return to all comments →
def beautifulBinaryString(b): num = 0 while len(b)>=3: if b[:3] == '010': num += 1 b = b[3:] else: b = b[1:] return num
Seems like cookies are disabled on this browser, please enable them to open this website
Beautiful Binary String
You are viewing a single comment's thread. Return to all comments →
Python solution without any tricks :-