The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value, and the median is the mean of the two middle values.
Implement the MedianFinder class:
- `MedianFinder()` initializes the MedianFinder object.
- `void addNum(int num)` adds the integer num from the data stream to the data structure.
- `double findMedian()` returns the median of all elements so far.
checklist Constraints
-10^5 <= num <= 10^5 There will be at least one element before calling findMedian. At most 5 * 10^4 calls to addNum and findMedian.