Problem Statement :
Solution I proposes :
public int getMedia(int[] input1, int[] input2) {
int[] merged = new int[input1.length + input2.length];
System.arraycopy(input1, 0, merged, 0, input1.length);
System.arraycopy(input2, 0, merged, input1.length, input2.length);
Arrays.sort(merged);
int mergedSize = merged.length;
int pos = mergedSize / 2;
return mergedSize % 2 == 0 ? (merged[pos] + merged[pos + 1]) / 2 : merged[pos] / 2;
}
You can put your solution as comment