Number of K-Length Sublists with Average at Least Target
Given a list of integers nums
, and integers k
and target
, return the number of sublists whose length is k
and its average value ≥ target
.
Constraints
n ≤ 100,000
wheren
is the length ofnums
https://binarysearch.com/problems/Number-of-K-Length-Sublists-with-Average-at-Least-Target
Examples
Example 1
Input
- nums =
[0, 9, 4, 5, 6]
- k =
3
- target =
5
Output
- answer =
2
Explanation
Sublist [9, 4, 5]
has average value of 6
and [4, 5, 6]
has average of 5
Leave a comment