Hard
The median is the middle value in an ordered list; for an even-sized list it is the average of the two middle values. Design a structure that supports a stream of integers. Implement MedianFinder with addNum(num) to add an integer, and findMedian() to return the median of all elements so far. Medians are reported to one decimal place (e.g. 2.0, 1.5).
Input: operations = ["MedianFinder","addNum","addNum","findMedian","addNum","findMedian"], values = [[],[1],[2],[],[3],[]] Output: [null,null,null,1.5,null,2.0]