void Solution::merge(vector &a, vector &b) {

for(int i=0; i<b.size();i++)

a.push_back(b[i]);

sort(a.begin(), a.end());

}

# Why is this submitting with full marks lol

**pswaldia**#2

Cuz why not. it is abiding by the time limit. But thatâ€™s not the expected time complexity.

Yeah exactly , why? The above one is acceptable but not this mentioned below:

```
int i=0,j=0;
while(i<A.size()&&j<B.size()){
if(A[i]<=B[j])i++;
else if(A[i]>=B[j]){
A.insert(A.begin()+i,B[j]);
j++;
}
```

because the time complexity of this one is m*n while of the upper one is (m+n)*log(m+n). In some cases, former can be lesser while in some cases later one depending on value distribution between m and n. Finally, it boils down to the values of m and n they are using for test cases.