Back to problems

Find Conflicting Events

Algorithm · Amazon · Medium

Requirements Input consists of event records, with each record containing a user, a region, and a timestamp. Use the following API: Treat two records as conflicting only if each condition below is satisfied: They belong to the same user. Their regions are not identical. The absolute difference between their timestamps is strictly smaller than K. Return the conflicting records or record pairs, depending on the output contract selected for the prompt. Examples Input: events =…

Checking your access…