Merge sorted array Leetcode

Can anyone explain what i am doing wrong?
ques->https://leetcode.com/problems/merge-sorted-array/

my code->https://ide.codingblocks.com/s/202835

Hi @mikkyimran, in your code u are overwriting your nums1 vector . just make a new vector instead of working on nums1 . and at last copy the content to nums1
refer this:-

1 Like

thanks @O17LPOLA020023

welcome @mikkyimran , mark your doubt as resolved if u got the answer