Beautiful Binary String

  • + 0 comments
    def beautifulBinaryString(b):
        # Write your code here
        operations = 0
        count = 0
        while count < len(b) - 2:
            if b[count: count+3] == "010":
                operations += 1
                count += 3
                continue
            count+= 1
        return operations