'How do I implement a python function that can gives the position of seris of zeros in a given string [closed]
I need to find positions of all series of zeroes in my string, and I am having really hard time implementing a python function that can do it.
It's output needs to be something like:
For Input: 100010001
Output: [(7,5), (3,1)]
Because there are series of zeroes at index 7 to 5 and 3 to 1 of the input string.
For Input: 11000010101
Output: [(8,5)]
Zeroes at position 1 and 3 are ignored because they are alone (not in a series)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
