Tap here to switch tabs
Problem
Submissions

Problem: Subarrays of Size K With Average at Least Threshold

med
30 min
Try to solve the Subarrays of Size K With Average at Least Threshold problem.

Statement

Given an array of integers arr and two integers k and threshold, return the number of contiguous subarrays of size k whose average value is greater than or equal to threshold.

Constraints:

  • 1≤1 \leq arr.length ≤105\leq 10^5

  • 1≤1 \leq arr[i] ≤104\leq 10^4

  • 1≤1 \leq k ≤\leq arr.length

  • 0≤0 \leq threshold ≤104\leq 10^4

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Subarrays of Size K With Average at Least Threshold

med
30 min
Try to solve the Subarrays of Size K With Average at Least Threshold problem.

Statement

Given an array of integers arr and two integers k and threshold, return the number of contiguous subarrays of size k whose average value is greater than or equal to threshold.

Constraints:

  • 1≤1 \leq arr.length ≤105\leq 10^5

  • 1≤1 \leq arr[i] ≤104\leq 10^4

  • 1≤1 \leq k ≤\leq arr.length

  • 0≤0 \leq threshold ≤104\leq 10^4