Your question is Subarrays Product Less Than K. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
AlphaGrep Securities monitors contiguous runs of positive integer signals and needs to count how many have a combined product below a threshold. Given an array nums of positive integers and an integer k, return the number of contiguous, non-empty subarrays whose product is strictly less than k.
Implement num_subarray_product_less_than_k(nums, k).
nums, a list of positive integers, and k, a positive integer.k.def num_subarray_product_less_than_k(nums, k):