to merge two arrays by taking input as two sorted array