Tap here to switch tabs
Problem
Submissions

Problem: Number of Ways to Split a String

med
30 min
Try to solve the Number of Ways to Split a String problem.

Statement

Given a binary string s, return the number of ways to split s into 33 nonempty substrings such that each substring contains the same number of $'1'$ characters.

Since the answer may be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 3≤3 \leq s.length ≤105\leq 10^5

  • s[i] is either $'0'$ or $'1'$.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Ways to Split a String

med
30 min
Try to solve the Number of Ways to Split a String problem.

Statement

Given a binary string s, return the number of ways to split s into 33 nonempty substrings such that each substring contains the same number of $'1'$ characters.

Since the answer may be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 3≤3 \leq s.length ≤105\leq 10^5

  • s[i] is either $'0'$ or $'1'$.