Problem 1513 · Medium

Number of Substrings With Only 1s

Count substrings made only of ones by counting the run length of ones at each position. The visual highlights a run and its growing substring total.

Open the interactive visualisation