My O(n) solution passed all test case on OJ. It would be nice if test case are strict. Here is my O(n) solution

```
public class Solution {
public double findMedianSortedArrays(int[] nums1, int[] nums2) {
int m = nums1.length;
int n = nums2.length;
int arr[] = new int[m+n];
int i=0,j=0,k=0;
while(i<m && j < n){
if(nums1[i] < nums2[j]){
arr[k]=nums1[i];
i++;k++;
}else{
arr[k]=nums2[j];
j++;k++;
}
}
while(i<m){
arr[k]=nums1[i];
k++;i++;
}
while(j<n){
arr[k]=nums2[j];
k++;j++;
}
int len = m+n;
if(len%2==0)
return (arr[len/2-1]+arr[len/2]+0.0)/2;
return arr[len/2]+0.0;
}
```

}