Algorithm · Airbnb · Easy
You are handed a collection of real-estate listings. Each listing pairs a city with the price at which a home in that city is listed. For each distinct city that appears, compute the median of its listing prices. The median is defined on a city's prices after sorting them. When the city has an odd count of prices, the median is the single value in the center position. When the count is even, the median is the mean of the two values sitting in the center. Input format: the…