The TransCompilator

Solved LeetCode program · 696 of 1,000

#0930 · Binary Subarrays With Sum

Medium Array chunk-14.md

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.

Open in Playground Browse all 1,000 problems

Expected stdout

4