# Merge Sorted Array

Try to solve the Merge Sorted Array problem.

## We'll cover the following

## Statement

Given two sorted integer arrays, $nums1$ and $nums2$, and the number of data elements in each array, $m$ and $n$, implement a function that merges the second array into the first one. You have to modify $nums1$ in place.

Note:Assume that $nums1$ has a size equal to $m + n$, meaning it has enough space to hold additional elements from $nums2$.

**Constraints:**

`nums1.length`

$= m + n$`nums2.length`

$= n$- $0 \leq m, n \leq 200$
- $1 \leq m + n \leq 200$
- $-10^3 \leq$
`nums1[i]`

,`nums2[j]`

$\leq 10^3$

## Example

The inputs will be two integer arrays and two integers representing the number of data elements in each array.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy