双指针,右指针前移 s *= nums[r] 当 s >= k 时,左指针前移直到条件满足,结果为满足条件区间长度的累加

#
# 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
#
# 
# @param nums int整型一维数组 
# @param k int整型 
# @return int整型
#
class Solution:
    def subarrayCnt(self , nums: List[int], k: int) -> int:
        # write code here
        l = r = 0
        n = len(nums)
        s = 1
        res = 0
        while r < n:
            s *= nums[r]
            while l <= r and s >= k:
                s //= nums[l]
                l += 1
            res += r - l + 1
            r += 1
        return res