Solved LeetCode program · 696 of 1,000
#0930 · Binary Subarrays With Sum
Original English source
The numbers is a list of 1, 0, 1, 0, and 1. The goal is 2. The last is the last position of numbers. The total is 0.
For every start from 0 to last.
The window is 0.
For every finish from start to last.
Increase window by item finish of numbers. If window is goal, add 1 to total.
Show total.
Expected stdout
4