Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 502 Bytes

File metadata and controls

13 lines (10 loc) · 502 Bytes

Problem 8: Logarithmic Product Window (Subarray Product Less Than K)

Problem Statement

Given an array of integers nums and an integer k, return the number of contiguous subarrays where the product of all the elements in the subarray is strictly less than k.

Input Format

  • An array of integers nums.
  • An integer k.

Example

Input: nums = [10, 5, 2, 6], k = 100
Output: 8
Explanation: The 8 subarrays are: [10], [5], [2], [6], [10, 5], [5, 2], [2, 6], [5, 2, 6].