Count Binary Substrings

Count Binary Substrings

Given a string s consisting only of '0' and '1', count the number of non-empty contiguous substrings that satisfy both conditions:

  1. The substring contains an eq...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: