Back to problems

Weather Data Energy-Usage Ranking

Algorithm · Intuit · Medium

Examples The first input line is top_n — how many of the ranked days to return, with 0 meaning "return them all". It is not a row count, so 2 with a single data row simply returns that one row. The rest of the input is the CSV, header included. Each returned record carries hdd = max(65 - mean_temp, 0), cdd = max(mean_temp - 65, 0), simple_score = hdd + cdd and weighted_score = 1.2*hdd + cdd, where mean_temp falls back to (maxt + mint) / 2 when avgt is missing. Example 1…

Checking your access…