← 返回 scale.ai 的题目列表Party Time Blocks and Deadzone Hours
类型:online_judge
Based on the provided data, complete the following tasks:
Find party time blocks for each neighborhood. The input includes a list of party information (party ID, start timestamp, end timestamp) and a list of geographic information per party (neighborhood name, city, state, party ID). The output should be a dictionary where the key is the neighborhood name and the value is the start and end hour of the party block.
Find the count of deadzone party hours per city, which is calculated based on the output of the first part. The deadzone is the gap hours between party time blocks. The input is a dictionary type, and you need to calculate the deadzone hours for each city.
A helper function is provided to extract hour values from timestamps.
Example
Input
{"party_info": [{"party_id": 1, "start_timestamp": 0, "end_timestamp": 3600}, {"party_id": 2, "start_timestamp": 7200, "end_timestamp": 10800}], "geo_info": [{"neighborhood_name": "N1", "city": "C1", "state": "S1", "party_id": 1}, {"neighborhood_name": "N1", "city": "C1", "state": "S1", "party_id": 2}]}