String
3234. Count the Number of Substrings With Dominant Ones
Given a binary string s. A substring is dominant in ones if its number of ones is ≥ the square of its number of zeros (cnt1 ≥ cnt0²). Count such non-empty substrings.
Loading…
Given a binary string s. A substring is dominant in ones if its number of ones is ≥ the square of its number of zeros (cnt1 ≥ cnt0²). Count such non-empty substrings.
Loading…