Walmart Supply Chain analytics receives daily warehouse temperature readings and two sorted capacity forecasts. Implement a function that returns both the number of days until a hotter reading and the median of the two forecasts without fully merging them.
For each temperature, return the number of days until a strictly hotter temperature occurs. If no hotter day exists, return 0. Also return the median of the values in sorted arrays a and b, treating their combined values as one sorted sequence. The arrays may have different lengths, but at least one must be nonempty.
Input: temperatures, a list of integers, and sorted integer lists a and b.
Output: A dictionary with next_hotter, a list of integers, and median, a number. The median may be an integer-valued float when the combined length is odd or even.
def supply_temperature_metrics(temperatures, a, b):