Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public:
- void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
- vector<int> v;
- int j=0;
- for(int i=0;i<m+n && j<n;i++)
- {
- if(nums1[i]==0)
- {
- nums1[i]=nums2[j];
- j++;
- }
- }
- sort(nums1.begin(),nums1.end());
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment