The TransCompilator

Solved LeetCode program · 569 of 1,000

#0795 · Number of Subarrays with Bounded Maximum

Medium Array chunk-12.md

Original English source

The numbers is a list of 2, 1, 4, and 3. The low is 2, while the high is 3. The last is 3, while the count is 0.
For every start from 0 to last.
The best is 0.
For every finish from start to last.
The value is item finish of numbers. If value is more than best, set best to value. If best is at least low and best is at most high, add 1 to count.

Show count.

Open in Playground Browse all 1,000 problems

Expected stdout

3