Search
⌘K
Get Premium
Leetcode 1573. Number of Ways to Split a String
Count the ways to split a binary string into three non-empty substrings that each contain the same number of '1's. The solution hinges on whether the total number of ones is divisible by three (with an all-zero special case) and reduces to counting valid cut positions, returning the result modulo 10^9+7.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.