Algorithm · Karat · Medium
You receive a collection of access log entries, where each entry is a pair (timestamp, resource_id) recording that the resource resource_id was accessed at time timestamp. Consider every possible continuous time window that spans 300 seconds. Find the resource that was accessed the greatest number of times within a single such window, and return that resource along with its access count in that window. If more than one resource reaches the same highest count, returning any…