Problem 1524 · Medium

Number of Sub-arrays With Odd Sum

Count subarrays with an odd sum by tracking prefix parity counts as the array is scanned. The visual shows the parity prefixes and the running total.

Open the interactive visualisation