I used a binary tree tally(std::map<int, int>) and another dynamic array to merge the two array in an ordered manner, and this could work with numbers in any order.

I then performed median calculation. The end.

Clearly I do not have a algorithm frame of mind and I just did bullshit.

Despise me if you want, I'm not a algorithmist, I just want to show how broken OJ really is.

```
class Solution {
public:
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
map<int, int> tally;
vector<int> arr;
const int j = nums1.size() + nums2.size();
arr.reserve(j);
for (auto &x : nums1) tally[x]++;
for (auto &x : nums2) tally[x]++;
for (auto &it : tally) arr.insert(arr.end(), it.second, it.first);
return (arr[(j - 1) / 2] + arr[j / 2]) * 0.5;
}
};
```

If I'm correct about the time complexity it should be ~~O(log(mn))~~ O(m+n) and the space complexity is ~O(m+n)~O(2*(m+n))