Subarrays with product limit
Your task
Given an array of positive integers nums and an integer k, return the number of contiguous subarrays whose product is strictly less than k. Array length up to 3e4, values >= 1.
Examples
num_subarray_product_less_than_k(nums: list[int], k: int) -> intExample 1
Input
num_subarray_product_less_than_k([10, 5, 2, 6], 100)Output
8