public int numSubarrayProductLessThanK(int[] nums, int k) {
int count = 0;
for (int i = 0; i < nums.length; ++i) {
int prod = 1;
int j = i;
for (; j < nums.length; ++j) {
if (prod * nums[j] >= k) {
break;
}
prod *= nums[j];
}
count += j  i;
}
return count;
}
Easy Accepted Solution

@farr3l I agree this is O(n^2) solution and in python also this solution leads to TLE.