30:00
Given an array of positive integers nums and an integer k, return the number of contiguous subarrays whose product is strictly less than k.
nums
k
1≤nums.length≤3×1041 \leq \text{nums.length} \leq 3 \times 10^41≤nums.length≤3×104
1≤nums[i]≤10001 \leq \text{nums}[i] \leq 10001≤nums[i]≤1000
0≤k≤1060 \leq k \leq 10^60≤k≤106
Run code to see results.
k = 100 is above 1, so single small numbers can already qualify. Start the window.
0
1
2
3
window product (log scale)
prod = 1 < k = 100
window [0, -1] size 0
count = 0
Given an array of positive integers and an integer k, count the contiguous subarrays whose product is strictly less than k.