Count Binary Substrings with Equal Consecutive Groups

Problem: Count Binary Substrings with Equal Consecutive Groups

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

  1. The substring c...

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: