Question: Python Write a function that, given a binary number as a string, computes the maximum number of consecutive ones. For example, for the binary string
Python

Write a function that, given a binary number as a string, computes the maximum number of consecutive ones. For example, for the binary string '0100111100000100111', the answer should be 4. Using your code, compute the maximum number of consecutive ones for the following strings: . '0' . '000001' . '1111' . '110011001' Note the following: . You are not allowed to use any built-in function that computes consecutive numbers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
