Median of two sorted arrays

cannot think of any method of solving it saw divide and conquer approach on geek for geeks but couldn’t understand the code so can u explain it to me in easy language

@jatinupadhyay786,
You can simply do this by 2 pointer approach, just maintain 2 pointers i (for arr1), j (for arr2). Now

if(arr1[i]<arr2[j]){
    ans.push_back(arr1[i]);
    i++;
}
else{
    ans.push_back(arr2[j]);
    j++;
} 

Do this till all elements are considered.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.