Practice Count Zero Request Servers
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given an integer n denoting the total number of servers and a 2D 0-indexed integer array logs, where logs[i] = [server_id, time] denotes that the server with id server_id received a request at time time. You are also given an integer x and a 0-indexed integer array queries. Return a 0-indexed integer array arr of length queries.length where arr[i] represents the number of servers that did not receive any requests during the time interval [queries[i] - x, queries[i]]. Note that the time intervals are inclusive.
Source: Count Zero Request Servers on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
n = 3, logs = [[1,3],[2,6],[1,5]], x = 5, queries = [10,11]
[1,2]
# Example 2
n = 3, logs = [[2,4],[2,1],[1,2],[3,1]], x = 2, queries = [3,4]
[0,1]
Constraints
Related LeetCode Problems
Practice more problems similar to Count Zero Request Servers.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.