Given JSON party submission data (start_time, end_time, party_id) and geographic data (neighborhood, town, state, city, party_id), compute party_windows: for each neighborhood, the (start_hour, end_hour) windows where at least one party has begun and at least one has not yet ended.
Asked in the technical phone screen stage. Prep guidance mentioned reviewing strptime and datetime.
Implement compute_party_windows(submissions, geography). Both inputs are lists of dictionaries, and times use %Y-%m-%d %H:%M:%S on the same date. Treat each party interval as active in every intersecting hourly bucket, with the end hour exclusive. Return a dictionary mapping each neighborhood to sorted, merged [start_hour, end_hour] windows. Include neighborhoods with no matching parties as empty lists.
%Y-%m-%d %H:%M:%Sstart_time < end_timedef compute_party_windows(submissions, geography):