Problem 1573 · Medium

Number of Ways to Split a String

Each cut between the one-groups must fall in a gap, so the answer is a product of two gap sizes that the counting of ones determines.

Open the interactive visualisation