You are given two sorted arrays, a[] and b[], both arranged in non-decreasing order. The task is to merge these arrays into a single sorted array without using extra space. Modify a so that it contains the first n elements and modify b so that it contains the last m elements.
Topics
Companies
Articles
Examples:
Expected Time Complexity O(n log m)
Expected Space Complexity O(1)
Constraints:
1 <= a.size(), b.size() <= 10^5
0 <= a[i], b[i] <= 10^7
Companies:
MicrosoftAdobeLinkedinGoldman SachsZoho
Topics:
ArraySorting Algorithms
Please log in to access the Submissions tab, where you can review your progress and explore code submissions from other participants.
Please log in to access the Solution tab and view detailed answers and explanations.
Please log in to access the Discussion tab and join conversations with other participants.
Access Restricted: Please Login to access the code editor and test cases.