Maximum Count Above Threshold in a Window - Google OA IIIT Allahabad
You are given an array A of size N, an integer K (1 ≤ K ≤ N), and a threshold G. Among all subarrays of length K, find the maximum number of elements strictly greater than G.
Problem
Input
First line: N K G
Second line: N space-separated integers A[i]
Output
Print a single integer: the maximum count.
Example 1:
Input:[5,3,2,[2,34,454,2,1]]
Output:2
Constraints:
1 ≤ N ≤ 2*10^5
1 ≤ K ≤ N
-10^9 ≤ A[i], G ≤ 10^9
solution.cpp
Loading...
Run code to see test results
00:00 / 69:42
Maximum Count Above Threshold in a Window - Google OA IIIT Allahabad
EasyMed•803 views
You are given an array A of size N, an integer K (1 ≤ K ≤ N), and a threshold G. Among all subarrays of length K, find the maximum number of elements strictly greater than G.