void merge(vector<int>& nums1, int m, vector<int>& nums2, int n)
{
int idx = 0;
for (int i = m; i < nums1.size(); i++)
nums1[i] = nums2[idx++];
sort(nums1.begin(), nums1.end());
}
'코딩테스트 > LeetCode' 카테고리의 다른 글
[LeetCode] Evaluate Reverse Polish Notation (0) | 2023.12.11 |
---|---|
[LeetCode] Rotate Array (0) | 2023.12.08 |
[LeetCode] Length of Last Word (0) | 2023.12.06 |
[LeetCode] 17 - Letter Combinations of a Phone Number (0) | 2023.11.22 |
[LeetCode] 34 - Find First and Last Position of Element in Sorted Array (0) | 2023.11.02 |