The TransCompilator

Solved LeetCode program · 507 of 1,000

#0713 · Subarray Product Less Than K

Medium Array chunk-11.md

Original English source

The numbers is a list of 10, 5, 2, and 6. The limit is 100. The left is 0. The product is 1. The count is 0.
For every right from 0 to the last position of numbers.
Set product to product times item right of numbers. Repeat while left is at most right and product is at least limit, Set product to product divided by item left of numbers, Add 1 to left. Increase count by right minus left plus 1.

Show count.

Open in Playground Browse all 1,000 problems

Expected stdout

8