Swift solutions with binary search, 732s
\nclass MedianFinder {\n\tvar nums: [Int]\n\n    init() {\n        self.nums = [Int]()\n    }\n    \nfunc addNum(_ num: Int) {\n    \tif nums.isEmpty {\n    \t\
```\nclass MedianFinder {\n\tvar nums: [Int]\n\n    init() {\n        self.nums = [Int]()\n    }\n    \nfunc addNum(_ num: Int) {\n    \tif nums.isEmpty {\n    \t\tnums.append(num)\n    \t\treturn\n    \t}\n\n        var start = 0, end = nums.count - 1\n        while start <= end {\n        \tvar mid = start + (end - start)/2\n        \tif num > nums[mid] {\n        \t\tstart = mid + 1\n        \t} else if num < nums[mid] {\n        \t\tend = mid - 1\n        \t} else {\n        \t\tstart = mid\n        \t\tbreak\n        \t}\n        }\n\n        nums.insert(num, at: start)\n    }\n    \n    func findMedian() -> Double {\n      \tlet count = nums.count\n      \tvar median: Double = 0\n      \tif count%2 == 0 {\n      \t\tmedian = Double(nums[count/2] + nums[(count-1)/2]) / 2\n      \t} else {\n      \t\tmedian = Double(nums[count/2])\n      \t}\n        return median\n    }\n}\n \n```
[]