import java.util.*;

//思路 暴力求解
public class Solution {
    /**
     * find median in two sorted array
     * @param arr1 int整型一维数组 the array1
     * @param arr2 int整型一维数组 the array2
     * @return int整型
     */
    public int findMedianinTwoSortedAray (int[] arr1, int[] arr2) {
           // write code here
      	//新建一个数组 数组长度为两数组之和
        int[] array = new int[arr1.length+arr2.length];
      	//将arr1和arr2的元素添加到新数组
        for (int i = 0; i < arr1.length; i++) {
            array[i]=arr1[i];
        }
        for (int j = arr1.length; j < arr1.length+arr2.length; j++) {
            array[j]=arr2[j-arr1.length];
        }
      	//排序
        Arrays.sort(array);
      	//返回排序后数组的上中位数
        return array[(array.length-1)/2];
       
    }
}