Problem

Give a Binary String of size , return the number of Odd Parity substrings to be generated from a string.

Solution (Linear Time)

Assuming we are given a zero-indexed string Define a function

Then, will be the solution.