educative.io

Educative

Product is of two numbers. how is a subarray with single element an answer?

product is of two numbers. How is a single element array like [2] can be considered an answer?
are we assuming 2*1 < 30?


Course: Grokking the Coding Interview: Patterns for Coding Questions - Learn Interactively
Lesson: Subarrays with Product Less than a Target (medium) - Grokking the Coding Interview: Patterns for Coding Questions

Hey @bee1!
[2] is just a single element subarray. So for better understanding, you can consider it as [2]*1.