Back to the Problem
Split on 1s (or scan with a counter) and take the longest zero block.
Complexity: O(|S|)