My code got accepted. So simple code. But when I look into others code in discussion I saw that they use iterative solution or used Binary search and also the category for this problem is given hard. So I am curious if my solution accidentally pass all the test cases :p Please let me know. Here is my code.

...

double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {

```
nums1.insert(nums1.end(), nums2.begin(), nums2.end());
sort(nums1.begin(), nums1.end());
int sz = nums1.size();
if(sz % 2 == 1)
{
return (double) nums1[sz/2];
}
else
{
return (double) (nums1[(sz/2)-1] + nums1[sz/2]) / 2.0;
}
}
```

...