Count Binary Substrings

A binary string is a string consisting only of 0s and 1s. A substring is a contiguous group of characters within a string.

Given a binary string, find the number of substrings that contain an equal n...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: