The Amazon Alexa development team needs to analyze request logs across numSkills different Alexa skills to understand their performance and user engagement.
The skills are indexed from 1 to numSkills, and the logs are provided as a 2D array requestLog of size m where requestLog[i] = [skill_ID, timeStamp] represents a request made at timeStamp to the skill with ID skill_ID.
You are given an integer numSkills, a 2D integer array requestLogs, an integer timeWindow (representing a lookback period), and an array of queryTimes containing q queries.
For each queryTime[i] determine the number of skills that did not receive a request in the time interval [queryTime[i] - timeWindow, queryTime[i]]. Return an array of length q containing the result of each of the query.
Note: If for some query in the numSkills received requestLog the given time interval for that query, then answer is 0.
Complete the function findIdleSkillsQuery in the editor.
findIdleSkillsQuery has the following parameters:
int numSkills: an integer denoting the number of skillsint[][] requestLogs: 2D array denoting the request logsint[] queryTime: an integer array denoting the query timesint timeWindow: an integer denoting the lookback period for queriesReturns
int[]: an integer array denoting the answers to the queries
🌷 A super special thanks to an old friend who kindly helped out! 🌷
numSkills = 3 requestLogs = [[1, 3], [2, 6], [1, 5]] queryTime = [10, 11] timeWindow = 5 return = [1, 2]

numSkills = 6 requestLogs = [[3, 2], [4, 3], [2, 6], [6, 3]] queryTime = [3, 2, 6] timeWindow = 2 return = [3, 5, 5]
numSkills = 6 requestLogs = [[3, 2], [4, 3], [2, 6], [6, 3]] queryTime = [1, 2, 3, 4, 5, 6] timeWindow = 1 return = [6, 5, 3, 4, 6, 5]
1 ≤ numSkills ≤ 10^51 ≤ m ≤ 10^51 ≤ q ≤ 10^51 ≤ requestLogs[i][0] ≤ n1 ≤ requestLogs[i][1] ≤ 10^51 ≤ queryTime[i] ≤ 10^51 ≤ timeWindow ≤ 10^5
- Count Promotional PeriodsOA · Seen Jun 2026
- Find Maximum Total Amount (SDE I, Fungible :)Seen Jun 2026
- Get Minimum AmountOA · Seen Jun 2026
- Find Minimum CostOA · Seen Jun 2026
- Get Smallest Base SegmentOA · Seen Jun 2026
- Select Least Resource TasksOA · Seen Jun 2026
- Product Category Group SizesPHONE SCREEN · Seen May 2026
- Count Connected ComponentsPHONE SCREEN · Seen May 2026
public int[] findIdleSkillsQuery(int numSkills, int[][] requestLogs, int[] queryTime, int timeWindow) {
// write your code here
}