max_flipped to 0 to keep track of the maximum index flipped.count to 0 to keep track of the number of flips made.result to 0 to keep track of the number of times the binary string is prefix-aligned.flips array.
a. Increment count by 1.
b. Update max_flipped to be the maximum of the current max_flipped and the current element in flips.
c. If max_flipped is equal to count, increment result by 1.result.