Algorithm · Snapchat · Medium
Requirements Create an event-counter class that accepts a collection of event timestamps and supports range-count queries: The implementation must satisfy these conditions: The timestamps can arrive in any order. Repeated timestamp values represent separate events and must each contribute to the count. query(start, end) must report how many events fall within the agreed time interval, including the chosen endpoint convention. After preprocessing, answering several queries…
Checking your access…