Getting 0 score

Why am I getting 0 score, please help me regarding the same.

Please send your code , so that i can understand what is going wrong.

I was able to debug. here is my code. #include using namespace std; int main() { int n; cin>>n; int *a = new int[n]; int *b = new int[n]; int *c = new int[n+n]; for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<n;i++) cin>>b[i]; int i,j,k; i = j = k = 0; while(i<n && j<n){ if(a[i]<b[j]){ c[k] = a[i]; k++; i++; } else{ c[k] = b[j]; k++; j++; } } while(i<n){ c[k] = a[i]; k++; i++; } while(j<n){ c[k] = b[j]; k++; j++; } int mid1 = n; int mid2 = mid1 - 1; cout<<(c[mid1]+c[mid2])/2; return 0; } Is it possible to solve this question in less than O(n).

Please view the rest of the messages on the chat box.

Complexity can’t be less than O(n) , because without reaching end of one array we can’t sure about the median.
And median of even length array is average of n/2th and n/2th + 1 element , you are taking n/2th and n/2th -1.