Kth Smallest in Subarray
Problem Overview
- Find the kth smallest integer for every contiguous subarray of size m in the given array.
- Input: array arr and integers k and m; Output: a list of kth smallest values for each subarray; constraints not specified.
- Applies to rolling analytics, monitoring thresholds, and ranking within moving windows.
- Asked in Amazon interviews; a coding interview problem and common interview question on array processing and ranking values.
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Input Variables
Execution Result:
