```
static int numOfSubArray(int[] nums, int k) {
int cnt = 0;
boolean flag;
for (int i = 0; i < nums.length; i++) {
flag = false;
int product = 1;
for (int j = i; j < nums.length; j++) {
product *= nums[j];
if (product >= k) {
flag = true;
break;
}
cnt++;
}
if (flag) continue;
}
return cnt;
}
```