Algorithm · Amazon · Medium
You are analyzing a set of server logs. Each log entry contains a request identifier (a string without spaces), followed by two integer timestamps: the start time and the end time (where start <= end). The time taken by that request is end - start. Your task is to find the k requests with the longest processing times. If multiple requests have the same duration, break ties by selecting the ones whose identifiers come first in dictionary (lexicographic) order. Print at most k…