Find Idle Skills Query
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! 🌷
1Example 1

2Example 2
3Example 3
Constraints
Limits and guarantees your solution can rely on.
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