Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Subarray Product Less Than K
Bookmark
Brute Force
Sliding Window
Input
Example 1
k = 0
All Ones
Longer
Custom
nums
=
[10, 5, 2, 6]
,
k
=
100
0
1
2
3
10
5
2
6
0
1
2
3
10
5
2
6
0
1
2
3
10
5
2
6
left
right
product =
1
×
10
=
10
count =
0
product =
10
k
k =
100
0
1
2
3
10
5
2
6
left
right
product =
10
×
5
=
50
count =
1
product =
50
k
k =
100
0
1
2
3
10
5
2
6
left
right
product =
50
×
2
=
100
count =
2
product =
100
k
k =
100
0
1
2
3
+1 subarrays end at right
10
5
2
6
left
right
count =
2
+
1
=
3
count =
3
product =
5
k
k =
100
0
1
2
3
10
5
2
6
left
right
include nums[
3
] =
6
count =
4
product =
10
k
k =
100
0
1
2
3
10
5
2
6
left
right
include nums[
2
] =
2
count =
5
product =
1
k
k =
100
0
1
2
3
10
5
2
6
left
right
include nums[
3
] =
6
count =
6
product =
2
k
k =
100
0
1
2
3
10
5
2
6
left
right
include nums[
3
] =
6
count =
7
product =
1
k
k =
100
0
1
2
3
10
5
2
6
count =
8
algo
master
.
io
Step:
Start of algorithm
0 / 28
Input
Example 1
k = 0
All Ones
Longer
Custom
nums
=
[10, 5, 2, 6]
,
k
=
100
0 / 28
algo
master
.
io
Step:
Start of algorithm