X-th Element

This Question Was Asked By Google

Two arrays and an element x is given. Find the element that would be at the xth position of the final sorted array.

Write a function solve that have the following parameter(s):
1.) arr1 = array of integer
2.) arr2 = array of integer
2.) x = integer to represent position

Example
Input:
array1 = [4,7,8,9]
array2 = [1,3]
x = 4

Output:
The function will return,
7

Explanation
The final sorted array would be {1,3,4,7,8,9} and the value at xth position is 7.

Constraints
• The number of elements in arrays will be greater than or equal to 1 and less than or equal to 300
• Every element in both arrays will be greater than or equal to 1 and less than 10000
• The value of x should be greater than or equal to 1 and less than 1000